Skip Menu |

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

Report information
The Basics
Id: 42332
Status: rejected
Priority: 0/
Queue: XML-LibXSLT

People
Owner: Nobody in particular
Requestors: peter_schlaifer [...] ibi.com
Cc:
AdminCc:

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



The xslbug.xsl, included in the zip-file documents 2 separate problems with the 1.63 version of LibXSLT. Be advised that the LibXSLT module is effectively unuseable with output method = text as follows: 1) < and > are always escaped unless you use the d-o-e option. This is just wrong. 2) the 'd-o-e' option inserts a newline before and after the text-element which is wrong and additionally makes this hack unuseable as a workaround. Summary of the files included in the zip file apply.pl: a simple perl script which loads libxslt and libxml, and process a list of files using the first arg: perl -w apply.pl xsl-file xml-file+ xslbug.xml: a trivial single-element xml file. xslbug.xsl: 3 simple, annotated output sequences which expose the two problems. console.txt: contains the output from running xsltproc, running LibXSLT, and the associated version information for all the modules and programs used. The workaround for this problem is to call the XSLTPROC module directly on file versions of the inputs and then load the results as needed for further processing.
Subject: xslbug.xsl
<!-- xslbug.xml: <?xml version="1.0"?> <DUMMY> </DUMMY> --> <!-- xslbug.xsl: --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text"/> <!-- stylesheet outputs <?xml version="1.0"?> how can this be correct behavior with the 'method = text ?? --> <xsl:template match="/" > <!-- desired output = '"testid: <hello>goodbye"' --> SOD&quot;simple-text: &lt;hello&gt;goodbye&quot;EOD <!-- simple-6ext ouputs SOD"simple-text: &lt;hello&gt;goodbye"EOD notice &quot is translated, while the &lt;,$gt; are not there should be no output escaping as indicated by youyr reference (it's this failure that led me to try a CDATA section) --> SOD<![CDATA["cdata-section: <hello>goodbye"]]>EOD <!-- cdata-section outputs SOD"cdata-section: &lt;hello&gt;goodbye"EOD notice < and > in the CDATA section are escaped. while the quotes are passed through. how can this be correct behavior (this failure led me to try d-o-e) --> SOD<xsl:text disable-output-escaping="yes">&quot;d-o-e-text-element: &lt;hello&gt;goodbye&quot;</xsl:text>EOD <!-- d-o-e outputs SOD "d-o-e-text-element: <hello>goodbye" EOD so this is the behavior I expected without d-o-e enabled except I get newlines before and after the text element: which makes it totally useless as a workaround. --> </xsl:template> </xsl:stylesheet> <!-- this is the complete unedited output C:\myTk\dd>xr apply xslbug xslbug <?xml version="1.0"?> SOD"simple-text: &lt;hello&gt;goodbye"EOD SOD"cdata-section: &lt;hello&gt;goodbye"EOD SOD "d-o-e-text-element: <hello>goodbye" EOD C:\myTk\dd> -->
Subject: xslbug.zip
Download xslbug.zip
application/zip 1.5k

Message body not shown because it is not plain text.

From: peter_schlaifer [...] ibi.com
On Mon Jan 12 10:45:17 2009, pxs42 wrote: Show quoted text
> The xslbug.xsl, included in the zip-file documents 2 separate problems > with the 1.63 version of LibXSLT. Be advised that the LibXSLT module is > effectively unuseable with output method = text as follows: > > 1) &lt; and &gt; are always escaped unless you use the d-o-e option. > This is just wrong. > > 2) the 'd-o-e' option inserts a newline before and after the > text-element which is wrong and additionally makes this hack unuseable > as a workaround. > > Summary of the files included in the zip file > > apply.pl: a simple perl script which loads libxslt and libxml, and > process a list of files using the first arg: perl -w apply.pl xsl-file > xml-file+ > > xslbug.xml: a trivial single-element xml file. > > xslbug.xsl: 3 simple, annotated output sequences which expose the two > problems. > > console.txt: contains the output from running xsltproc, running LibXSLT, > and the associated version information for all the modules and programs > used. > > The workaround for this problem is to call the XSLTPROC module directly > on file versions of the inputs and then load the results as needed for > further processing. >
On Mon Jan 12 10:45:17 2009, pxs42 wrote: Show quoted text
> The xslbug.xsl, included in the zip-file documents 2 separate problems > with the 1.63 version of LibXSLT. Be advised that the LibXSLT module is > effectively unuseable with output method = text as follows: > > 1) &lt; and &gt; are always escaped unless you use the d-o-e option. > This is just wrong. > > 2) the 'd-o-e' option inserts a newline before and after the > text-element which is wrong and additionally makes this hack unuseable > as a workaround. > > Summary of the files included in the zip file > > apply.pl: a simple perl script which loads libxslt and libxml, and > process a list of files using the first arg: perl -w apply.pl xsl-file > xml-file+ > > xslbug.xml: a trivial single-element xml file. > > xslbug.xsl: 3 simple, annotated output sequences which expose the two > problems. > > console.txt: contains the output from running xsltproc, running LibXSLT, > and the associated version information for all the modules and programs > used. > > The workaround for this problem is to call the XSLTPROC module directly > on file versions of the inputs and then load the results as needed for > further processing. >
Subject: problem with XML:LibXSLT
RT-Send-CC: pajas [...] matfyz.org, gzlist [...] googlemail.com
this bug should be closed or deleted - my dumb user error of loading output text into xml dom and printing that instead of using the stylesheet->output_string method. my apologies.
Dne po 12.led.2009 13:11:10, pxs42 napsal(a): Show quoted text
> this bug should be closed or deleted - my dumb user error of loading > output text into xml dom and printing that instead of using the > stylesheet->output_string method. my apologies.
Closing. The documentation will attempt to warn about this pitfall. -- Petr