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:
libxml2 | 20900 |
libxslt | 10127 |
XML::LibXML | 2.0014 |
XML::LibXSLT | 1.80 |
perl | strawberry 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 | |
by choroba (Cardinal) on Feb 14, 2013 at 10:29 UTC | |
by Anonymous Monk on Feb 14, 2013 at 10:36 UTC | |
by choroba (Cardinal) on Feb 14, 2013 at 10:45 UTC | |
by Anonymous Monk on Feb 14, 2013 at 11:10 UTC | |
by choroba (Cardinal) on Feb 20, 2013 at 17:39 UTC | |
Re: XML::LibXSLT ignoring namespace on some Win32 machines
by Anonymous Monk on Feb 14, 2013 at 03:30 UTC |
Back to
Seekers of Perl Wisdom