Skip Menu |

This queue is for tickets about the XML-XSLT CPAN distribution.

Report information
The Basics
Id: 76938
Status: resolved
Priority: 0/
Queue: XML-XSLT

People
Owner: Nobody in particular
Requestors: bitcard-web [...] brouillet.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 0.48
  • 0.50_2
Fixed in: (no value)



Subject: Error in CPATH test on node attribute
Hello, In the following code, a test on a node attribute does not work. The expected output (as given by xsltproc for instance) is: <?xml version="1.0"?> <ul><li>1 :This is one</li><li>2 :This is two</li><li>3 :This is three</li></ul> Using the XML::XSLT module below, I get <ul><li>1 :This is three</li><li>2 :This is three</li><li>3 :This is three</li></ul> Any idea ? Known bug ? Marcel. XML::XSLT Revision 1.25 2004/02/19 08:38:40 gellyfish Perl v5.12.2 ; Linux 2.6.36-gentoo-r5 [program follows:] use XML::XSLT; my $xsl=' <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <ul> <li>1 :<xsl:value-of select="uppernode/mynode[@num=1]"/></li> <li>2 :<xsl:value-of select="uppernode/mynode[@num=2]"/></li> <li>3 :<xsl:value-of select="uppernode/mynode[@num=3]"/></li> </ul> </xsl:template> </xsl:stylesheet> '; my $xml="<?xml version='1.0'?> <uppernode> <mynode num='1'>This is one</mynode> <mynode num='2'>This is two</mynode> <mynode num='3'>This is three</mynode> </uppernode> "; my $xslt = XML::XSLT->new($xsl, warnings => 1); $xslt->transform($xml); print $xslt->toString."\n";
Subject: example_problem_xslt.pl
use XML::XSLT; my $xsl=' <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <ul> <li>1 :<xsl:value-of select="uppernode/mynode[@num=1]"/></li> <li>2 :<xsl:value-of select="uppernode/mynode[@num=2]"/></li> <li>3 :<xsl:value-of select="uppernode/mynode[@num=3]"/></li> </ul> </xsl:template> </xsl:stylesheet> '; my $xml="<?xml version='1.0'?> <uppernode> <mynode num='1'>This is one</mynode> <mynode num='2'>This is two</mynode> <mynode num='3'>This is three</mynode> </uppernode> "; my $xslt = XML::XSLT->new($xsl, warnings => 1); $xslt->transform($xml); print $xslt->toString."\n";
On Wed May 02 05:17:44 2012, mbrouillet wrote: Show quoted text
> Hello, > > In the following code, a test on a node attribute does not work. The > expected output (as given by xsltproc for instance) is: > > <?xml version="1.0"?> > <ul><li>1 :This is one</li><li>2 :This is two</li><li>3 :This is > three</li></ul> > > Using the XML::XSLT module below, I get > <ul><li>1 :This is three</li><li>2 :This is three</li><li>3 :This is > three</li></ul> > > Any idea ? Known bug ? > > Marcel. > XML::XSLT Revision 1.25 2004/02/19 08:38:40 gellyfish > Perl v5.12.2 ; Linux 2.6.36-gentoo-r5 > > [program follows:] > > use XML::XSLT; > > my $xsl=' > <xsl:stylesheet version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > <xsl:template match="/"> > <ul> > <li>1 :<xsl:value-of select="uppernode/mynode[@num=1]"/></li> > <li>2 :<xsl:value-of select="uppernode/mynode[@num=2]"/></li> > <li>3 :<xsl:value-of select="uppernode/mynode[@num=3]"/></li> > </ul> > </xsl:template> > </xsl:stylesheet> > '; > > my $xml="<?xml version='1.0'?> > <uppernode> > <mynode num='1'>This is one</mynode> > <mynode num='2'>This is two</mynode> > <mynode num='3'>This is three</mynode> > </uppernode> > "; > > my $xslt = XML::XSLT->new($xsl, warnings => 1); > $xslt->transform($xml); > print $xslt->toString."\n"; >
Hi, a fix for this has gone in as https://github.com/jonathanstowe/XML-XSLT/commit/2127a5e2cb93c1e0b4dffb1a7ef7a00ed89c2fd9 I've used your example as the basis of a test. It should be in the next release.