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.

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

In reply to XML::LibXSLT ignoring namespace on some Win32 machines by choroba

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.