Skip Menu |

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

Report information
The Basics
Id: 29572
Status: resolved
Priority: 0/
Queue: XML-LibXSLT

People
Owner: Nobody in particular
Requestors: work [...] anomalizer.net
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



Subject: disable output escaping + cdata does not work
perl v5.8.8 XML::LibXSLT v1.62 XML::LibXML v1.62.001 libxml2 v2.6.28 libxslt v1.1.20 The example cited here fails: http://www.dpawson.co.uk/xsl/sect2/ N2215.html#d3931e259 PHP versions of libxml+libxslt also had this issue: http://bugs.php.net/ bug.php?id=29837
On ne 23.zář.2007 07:44:43, http://anomalizer.livejournal.com/ wrote: Show quoted text
> perl v5.8.8 > XML::LibXSLT v1.62 > XML::LibXML v1.62.001 > libxml2 v2.6.28 > libxslt v1.1.20 > > The example cited here fails: http://www.dpawson.co.uk/xsl/sect2/ > N2215.html#d3931e259 > > PHP versions of libxml+libxslt also had this issue:
http://bugs.php.net/ Show quoted text
> bug.php?id=29837
I cannot reproduce this with libxslt-1.1.21. The output is <?xml version="1.0"?> <tr> Please post a test case in form of a perl-script if you think otherwise. -- Petr
On ne 23.zář.2007 07:44:43, http://anomalizer.livejournal.com/ wrote: Show quoted text
> perl v5.8.8 > XML::LibXSLT v1.62 > XML::LibXML v1.62.001 > libxml2 v2.6.28 > libxslt v1.1.20 > > The example cited here fails: http://www.dpawson.co.uk/xsl/sect2/ > N2215.html#d3931e259 > > PHP versions of libxml+libxslt also had this issue:
http://bugs.php.net/ Show quoted text
> bug.php?id=29837
I cannot reproduce this with libxslt-1.1.21. The output is <?xml version="1.0"?> <tr> Please post a test case in form of a perl-script if you think otherwise. -- Petr
I've attached the code. Tried with both libxslt 1.1.20 and 1.1.22
#!/usr/bin/perl use strict; use warnings; use XML::LibXSLT; use XML::LibXML; my $parser = XML::LibXML->new(); my $source = $parser->parse_string(<<'EOT'); <some-xml/> EOT my $style_doc = $parser->parse_string(<<'EOT2'); <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/" > <xsl:text disable-output-escaping="yes"><![CDATA[<tr>]]></xsl:text> </xsl:template> </xsl:stylesheet> EOT2 my $xslt = XML::LibXSLT->new(); my $stylesheet = $xslt->parse_stylesheet($style_doc); my $results = $stylesheet->transform($source); print $stylesheet->output_string($results);
From: pajas [...] matfyz.cz
Ok, now I can reproduce it. It strangely depends on how you parse the stylesheet: when parsed from a DOM tree one gets &lt;tr&gt;, whem parsed from file (parse_stylesheet_file) one gets <tr>. I'll investigate... -- Petr
Dne út 25.zář.2007 15:32:59, PAJAS napsal(a): Show quoted text
> Ok, now I can reproduce it. It strangely depends on how you parse the > stylesheet: when parsed from a DOM tree one gets &lt;tr&gt;, whem > parsed from file (parse_stylesheet_file) one gets <tr>. > > I'll investigate... > -- Petr
Hi, the problem turned out to be existence of CDATA in the stylesheet. libxslt assumes the stylesheet XML was parsed with the XML_PARSE_NOCDATA option which merges CDATA sections into adjacent text nodes. I have mentioned this requirement in the documentation of parse_stylesheet and provided an example on how to setup the parser to use this flag (this will require XML::LibXML 1.70 - currently in SVN). All changes are in the SVN. Thanks for the report. -- Petr