Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

XML::LibXSLT ignoring namespace on some Win32 machines

by choroba (Chancellor)
on Feb 13, 2013 at 13:49 UTC ( #1018539=perlquestion: print w/replies, xml ) Need Help??
choroba has asked for the wisdom of the Perl Monks concerning the following question:

I was always getting scarce FAIL reports from CPAN testers for a module I inherited (Treex::PML) at work. I had not been able to reproduce the problem, so I was ignoring them. Recently, the error started to occur at two of our testing machines with MSWin 7 64-bit or XP 32-bit. The problem can be easily reduced to the following:
#!/usr/bin/perl use warnings; use strict; use Test::More tests => 1; use XML::LibXML; use XML::LibXSLT; my $source = XML::LibXML->load_xml(string => <<'__END_XML__'); <?xml version="1.0" encoding="UTF-8"?> <r xmlns=""/> __END_XML__ my $style_doc = XML::LibXML->load_xml(string => <<'__END_XML__'); <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="" xmlns="" > <xsl:template match="*"> <xsl:element name="{name()}"> </xsl:element> </xsl:template> </xsl:stylesheet> __END_XML__ my $style = XML::LibXSLT->new->parse_stylesheet($style_doc); is($style->transform($source)->toString, <<'__END_XML__', 'Namespace c +hanged'); <?xml version="1.0"?> <r xmlns=""/> __END_XML__

In other words, the transformation should only change the namespace of the element. On the affected machines, though, the namespace is changed to the empty one.

The affected 64 bit machine has the following configuration:

perlstrawberry 5.14.3 for MSWin32-x86-multithread

It seems as a bug in XML::LibXSLT or its underlying C libraries, but their tests are not failing. Can anyone help me understand the cause of the bug?

Update: Noticed the second failing machine.

لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re: XML::LibXSLT ignoring namespace on some Win32 machines (libxslt-1.1.27 bug)
by Anonymous Monk on Feb 14, 2013 at 03:38 UTC
      Thank you thousand times! That's exactly the problem. The next step for me is to find out how to use the newer library with strawberry :-)
      لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      Bug reported: rt://83368. The reply came surprisingly fast, containing the fixed binaries as well.
      لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re: XML::LibXSLT ignoring namespace on some Win32 machines
by Anonymous Monk on Feb 14, 2013 at 03:30 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1018539]
Approved by Corion
Front-paged by MidLifeXis
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2017-06-22 18:52 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (528 votes). Check out past polls.