Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Missing index on first of multiple children in human readable XPath #54

Open
spoeschel opened this issue Jul 28, 2017 · 0 comments
Open
Labels
bug Description of a bug fix Solution for a bug or enhancement review wanted Needs review before acceptance

Comments

@spoeschel
Copy link

When the notation of SVRL's @location is set to a human readable XPath (XSLT parameter full-path-notation set to 2), the following happens:

If at any component of such a human readable XPath multiple children exist and the first one on that level is selected, the necessary index [1] is missing. This means that all children on that level are selected - instead of just the first one.

The reason is the test in line 833 of /trunk/schematron/code/iso_schematron_skeleton_for_saxon.xsl. This test can be fixed by extending the check (when to output the index) from the presence of preceding siblings to also the presence of following siblings.

So just from:

preceding-sibling::*[name(.)=name(current())]

to

preceding-sibling::*[name(.)=name(current())] or following-sibling::*[name(.)=name(current())]
@tgraham-antenna tgraham-antenna added bug Description of a bug fix Solution for a bug or enhancement review wanted Needs review before acceptance labels Feb 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Description of a bug fix Solution for a bug or enhancement review wanted Needs review before acceptance
Projects
None yet
Development

No branches or pull requests

2 participants