Project

Profile

Help

Bug #6419

closed

Union of nodes in a Template Match produces wrong output in Trace

Added by Adrian Bird 7 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Diagnostics
Sprint/Milestone:
-
Start date:
2024-05-10
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
12, trunk
Fix Committed on Branch:
12, trunk
Fixed in Maintenance Release:
Platforms:
Java

Description

When using the latest version of xspec, 3.0.3, I had some odd results with a match template that included multiple nodes in a union. Having looked at the Saxon trace I can see that is causing xspec problems.

The problem happens when the template processes a node that is not first in the union e.g. when <xsl:template match="dummyNode | nodeB"> processes nodeB.
The Saxon trace has some column numbers that are wrong but it also says that the source node is nodeB with the template matching dummyNode rather than nodeB. It seems to just use the first node from the union in the trace. It is the column numbers that cause problems for xspec.

The example stylesheet has a variable with both nodeA and nodeB nodes and the main template uses apply-templates to process those nodes. There are 2 templates to handle nodeA and nodeB. I've used dummyNode to represent a non-existant node as far as the test is concerned. 1 template has "nodeA | dummyNode" and this is fine. 1 template has "dummyNode | nodeB" and this is where I see the problems. The stylesheet does not need a source file.

I've attached the trace output from Saxon as well as the stylesheet.

Adrian


Files

MatchUnionTest.xslt (871 Bytes) MatchUnionTest.xslt Stylesheet Adrian Bird, 2024-05-10 09:01
MatchUnionTestTrace.xml (3.47 KB) MatchUnionTestTrace.xml Saxon Trace output Adrian Bird, 2024-05-10 09:01

Please register to edit this issue

Also available in: Atom PDF