Project

Profile

Help

Bug #4624

Matching with namespaces in SaxonJS / NodeJS

Added by Wendell Piez about 1 month ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
XSLT Conformance
Sprint/Milestone:
-
Start date:
2020-06-29
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

Using SaxonJS and invoking from the node-js CL, I am finding that namespaces are not lining up as expected.

An XSLT is attached. It can be run on itself. It shows two key declarations, both of which should work, but only one does. The one that does not work is relying on an xpath-default-namespace setting for matching. The one that works uses an explicit namespace prefix (matching an element with an unprefixed name in the input document). Plain template matches work fine with the xpath-default-namespace setting.

Thanks! Wendell

ns-bug1.xsl (1.14 KB) ns-bug1.xsl Wendell Piez, 2020-06-29 18:35

Related issues

Has duplicate Saxon-JS - Bug #4630: Elements not matched when using `match="foo[. is key('some-key', value)[1]]"` if elements are in a namespace and xpath-default-namespace is usedDuplicate2020-07-03

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by Michael Kay about 1 month ago

  • Project changed from Saxon to Saxon-JS
  • Category set to XSLT Conformance

#2 Updated by Michael Kay about 1 month ago

  • Status changed from New to In Progress

Created XSLT3 test case key-098. Problem reproduced.

#3 Updated by Michael Kay about 1 month ago

Seems to be an XX compiler problem: the key in question compiles to

            {
               "N": "p.nodeTest",
               "role": "match",
               "test": "NE nQ{}data",
               "sType": "1NE nQ{}data",
               "ns": "= xml=~ fn=~ xsl=~ xs=~ math=~ "
            },

which is clearly incorrect.

#4 Updated by Michael Kay about 1 month ago

  • Status changed from In Progress to Resolved
  • Assignee set to Michael Kay
  • Applies to JS Branch 2.0 added
  • Fix Committed on JS Branch 2.0 added

Fixed. In the compiler module key.xsl, match pattern with match="xsl:key", pick up the $xpath-default-namespace tunnel parameter and add the value to the generated pattern element.

#5 Updated by Debbie Lockett 17 days ago

  • Has duplicate Bug #4630: Elements not matched when using `match="foo[. is key('some-key', value)[1]]"` if elements are in a namespace and xpath-default-namespace is used added

Please register to edit this issue

Also available in: Atom PDF Tracking page