Project

Profile

Help

Bug #4601

Problem with namespaces containing "="

Added by Michael Kay 3 months ago. Updated 3 days ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
XSLT Conformance
Sprint/Milestone:
-
Start date:
2020-06-17
Due date:
% Done:

0%

Estimated time:
Applies to JS Branch:
2.0
Fix Committed on JS Branch:
2.0
Fixed in JS Release:
SEF Generated with:
Company:
-
Contact person:
-
Additional contact persons:
-

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 "

History

#1 Updated by Michael Kay 3 months ago

Added XSLT3 test case namespace-6201

#2 Updated by John Lumley 3 months 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.

#3 Updated by Debbie Lockett 3 days 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.

Please register to edit this issue

Also available in: Atom PDF Tracking page