http://www.perlmonks.org?node_id=1018539

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="http://1.net/ns0"/> __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="http://www.w3.org/1999/XSL/Transform" xmlns="http://1.net/ns1" > <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="http://1.net/ns1"/> __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:

libxml220900
libxslt10127
XML::LibXML2.0014
XML::LibXSLT1.80
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