Project

Profile

Help

Bug #4624

closed

Matching with namespaces in SaxonJS / NodeJS

Added by Wendell Piez over 4 years ago. Updated over 3 years ago.

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

100%

Estimated time:
Applies to JS Branch:
2
Fix Committed on JS Branch:
2
Fixed in JS Release:
SEF Generated with:
Platforms:
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


Files

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

Related issues

Has duplicate SaxonJS - 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

Actions
Actions #1

Updated by Michael Kay over 4 years ago

  • Project changed from Saxon to SaxonJS
  • Category set to XSLT Conformance
Actions #2

Updated by Michael Kay over 4 years ago

  • Status changed from New to In Progress

Created XSLT3 test case key-098. Problem reproduced.

Actions #3

Updated by Michael Kay over 4 years 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.

Actions #4

Updated by Michael Kay over 4 years 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.

Actions #5

Updated by Debbie Lockett over 4 years 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
Actions #6

Updated by Community Admin almost 4 years ago

  • Applies to JS Branch 2 added
  • Applies to JS Branch deleted (2.0)
Actions #7

Updated by Community Admin almost 4 years ago

  • Fix Committed on JS Branch 2 added
  • Fix Committed on JS Branch deleted (2.0)
Actions #8

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