GNOME Bugzilla – Bug 591449
xsl:output method=text doesn't work with saxon:output
Last modified: 2021-07-05 10:59:26 UTC
Summary: ==================== When <xsl:output method="text"> is used with <saxon:output file="filename"> it doesn't output text, but XML. Overview Description: ==================== With "normal" output (not using saxon:output), method=text produces text output, as expected. The same example fails to produce text output, when saxon:output is used: * An XML declaration is produced. * special characters are escaped. The example below uses one stylesheet to produce both, the expected and the unexpected result at the same time. Steps to Reproduce: ==================== The following stylesheet (test.xsl): <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:saxon="http://icl.com/saxon" extension-element-prefixes="saxon"> <xsl:output method="text" indent="no" /> <xsl:template match="code"> <saxon:output file="unexpected.xml"> <xsl:apply-templates /> </saxon:output> <xsl:apply-templates /> <!-- expected output --> </xsl:template> </xsl:stylesheet> With the following source document (source.xml): <?xml version='1.0' encoding='UTF-8'?> <code><![CDATA[ Some <free> &text. ]]></code> Process with xsltproc to create both expected, and unexpected results: $ xsltproc --output expected.xml test.xsl source.xml Actual Results (unexpected.xml): ==================== <?xml version="1.0"?> Some <free> &text. Expected Results (expected.xml): ==================== Some <free> &text. Where did you find the bug? ==================== vanilla xsltproc that ships with Ubuntu 9.04 Jaunty Jackalope: $ xsltproc --version Using libxml 20632, libxslt 10124 and libexslt 813 xsltproc was compiled against libxml 20632, libxslt 10124 and libexslt 813 libxslt 10124 was compiled against libxml 20632 libexslt 813 was compiled against libxml 20632
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxslt/-/issues/ Thank you for your understanding and your help.