2011-10-26 03:41:28 |
Neal McBurnett |
description |
The extension functions seem to be disabled in the Saxon B XSLT 2.0 processor that is packaged for Ubuntu/Debian. This is very surprising, because Saxon is maybe the only conformant XSLT 2.0 processor that is free, and extension functions are one of it's big selling points.
If there are are strong reasons for disabling these functions, this should be clearly expressed in the manual pages. (Note, that the manual is otherwise very complete, and descriptive.)
As an example, currently it is not possible to use the often-required xsl:result-document function:
$ saxonb-xslt -t -xsl:test.xsl -s:test.xml
Saxon 9.0.0.4J from Saxonica
Java version 1.6.0_14
Error at xsl:result-document on line 5 of file:/home/jerzy/xml/tests/test.xsl:
xsl:result-document is disabled when extension functions are disabled
Failed to compile stylesheet. 1 error detected.
The same error happens when the program is invoked directly, circumventing the shipped script:
$ java -classpath /usr/share/java/saxonb.jar net.sf.saxon.Transform -xsl:test.xsl -s:test.xml
Error at xsl:result-document on line 5 of file:/home/jerzy/xml/tests/test.xsl:
xsl:result-document is disabled when extension functions are disabled
Failed to compile stylesheet. 1 error detected.
The 'test.xsl' stylesheet file:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="value">
<xsl:result-document href="{.}">
<test>
<xsl:value-of select="."/>
</test>
</xsl:result-document>
</xsl:template>
</xsl:stylesheet>
The 'test.xml' source XML file:
<?xml version='1.0' encoding='UTF-8'?>
<data>
<value>A1</value>
<value>B1</value>
<value>C1</value>
<value>A2</value>
<value>B2</value>
<value>C2</value>
</data> |
---- modified description to describe how to re-enable extension functions ----
The extension functions are disabled by default in the Saxon B XSLT 2.0 processor that is packaged for Ubuntu/Debian. The resulting error messages can be confusing, especially to those following directions that apply for the original upstream packaging, which enables extension functions by default. The error message and/or documentation should clarify the issues and options more clearly - e.g. that if the XSLT stylesheet is trusted as an executable application, extensions can be re-enabled via the "-ext:on" option.
---- continuing from the original bug description ----
If there are are strong reasons for disabling these functions, this should be clearly expressed in the manual pages. (Note, that the manual is otherwise very complete, and descriptive.)
As an example, currently it is not possible to use the often-required xsl:result-document function:
$ saxonb-xslt -t -xsl:test.xsl -s:test.xml
Saxon 9.0.0.4J from Saxonica
Java version 1.6.0_14
Error at xsl:result-document on line 5 of file:/home/jerzy/xml/tests/test.xsl:
xsl:result-document is disabled when extension functions are disabled
Failed to compile stylesheet. 1 error detected.
The same error happens when the program is invoked directly, circumventing the shipped script:
$ java -classpath /usr/share/java/saxonb.jar net.sf.saxon.Transform -xsl:test.xsl -s:test.xml
Error at xsl:result-document on line 5 of file:/home/jerzy/xml/tests/test.xsl:
xsl:result-document is disabled when extension functions are disabled
Failed to compile stylesheet. 1 error detected.
The 'test.xsl' stylesheet file:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="value">
<xsl:result-document href="{.}">
<test>
<xsl:value-of select="."/>
</test>
</xsl:result-document>
</xsl:template>
</xsl:stylesheet>
The 'test.xml' source XML file:
<?xml version='1.0' encoding='UTF-8'?>
<data>
<value>A1</value>
<value>B1</value>
<value>C1</value>
<value>A2</value>
<value>B2</value>
<value>C2</value>
</data> |
|