Bug #4601
closedProblem with namespaces containing "="
100%
Description
With the following stylesheet
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:x="http://example.org/x?subject="
xmlns:y="http://example.org/x?subject"
version="1.0"
>
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:variable name="test">
<xsl:call-template name="get-test-data"/>
</xsl:variable>
<xsl:call-template name="dump-test-data">
<xsl:with-param name="test" select="$test"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="get-test-data">
<x:item>x</x:item>
<y:item>y</y:item>
</xsl:template>
<xsl:template name="dump-test-data">
<xsl:param name="test"/>
<xsl:for-each select="$test/x:item | $test/y:item">
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:template>
</xsl:transform>
Saxon-JS 2 outputs "y" (should be "xy")
Looking at the SEF files, for line 19 the XJ compiler outputs
"N": "elem",
"name": "x:item",
"nsuri": "http://example.org/x?subject=",
"namespaces": "x y",
while the XX compiler produces:
"N": "elem",
"name": "x:item",
"sType": "1NE nQ{http://example.org/x?subject=}item ",
"nsuri": "http://example.org/x?subject=",
"namespaces": "x=http://example.org/x?subject y=http://example.org/x?subject",
"line": "19",
The XX compiler output also includes incorrect ns attributes, for example:
"ns": "= xml=~ fn=~ xsl=~ x=http://example.org/x?subject y=http://example.org/x?subject "
Updated by John Lumley over 4 years ago
- Status changed from New to In Progress
The issue is that in at least four places, both in XSLT code and in JavaScript code we have used tokenize($ns,'=')
or split($ns,"="
) to split the mapping item in to prefix and URI, which of course fails in the case where a URI contains an equals sign. This failure has been fixed, and namespace-2601
passes, but it also shows the XX compiler being a little profligate with namespace requirements when just the prefix should be sufficient.
Updated by Debbie Lockett about 4 years ago
- Status changed from In Progress to Resolved
- Fix Committed on JS Branch 2.0 added
Marking as resolved: the code patch was transferred to the saxon-js-enterprise git repo on 2020-06-22.
Updated by Community Admin over 3 years ago
- Applies to JS Branch 2 added
- Applies to JS Branch deleted (
2.0)
Updated by Community Admin over 3 years ago
- Fix Committed on JS Branch 2 added
- Fix Committed on JS Branch deleted (
2.0)
Updated by Debbie Lockett over 3 years ago
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in JS Release set to Saxon-JS 2.1
Bug fix applied in the Saxon-JS 2.1 maintenance release.
Please register to edit this issue
Also available in: Atom PDF Tracking page