Bug #4725
closedSaxon-JS 2 fails to compile XSLT stylesheet giving error "Required cardinality of value of parameter $static-base-uri is exactly one; supplied value is empty"
100%
Description
When trying to reduce a stylesheet to identify the cause of a problem in Saxon Java I run into a problem with a stylesheet that compiles with Saxon EE 10.2 Java and is executable then with Saxon JS 2 under Node and xslt3
but which xslt3
can't compile, giving an error
Failed to compile stylesheet: Required cardinality of value of parameter $static-base-uri is exactly one; supplied value is empty Error XTTE0590 at xpath.xsl#628 Failed to compile stylesheet Error XTTE0590 at xpath.xsl#628 Required cardinality of value of parameter $static-base-uri is exactly one; supplied value is empty
The sample code is not very meaningful as it was just meant to identify where Saxon Java knows or does not know about the $value
variable in an xsl:accumulator-rule
:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="3.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="#all"
expand-text="yes">
<xsl:accumulator name="iterate-value-test" as="xs:integer" initial-value="0">
<xsl:accumulator-rule match="foo">
<xsl:variable name="test" select="$value"/>
<xsl:sequence select="$test + 1"/>
</xsl:accumulator-rule>
</xsl:accumulator>
<xsl:mode on-no-match="shallow-copy" use-accumulators="iterate-value-test"/>
<xsl:template match="foo">
<xsl:copy>
<xsl:attribute name="accumulator-test" select="accumulator-before('iterate-value-test')"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/" name="xsl:initial-template">
<xsl:next-match/>
<xsl:comment xmlns:saxon="http://saxon.sf.net/">Run with {system-property('xsl:product-name')} {system-property('xsl:product-version')} {system-property('Q{http://saxon.sf.net/}platform')}</xsl:comment>
</xsl:template>
</xsl:stylesheet>
I am a bit lost as to where the static-base-uri
problem is caused by but as the code compiles with Saxon EE Java I guess the Saxon JS compiler has a bug here.
Please register to edit this issue
Also available in: Atom PDF Tracking page