In complex XSLT patterns, the "child-or-top" logic for parentless elements is not implemented
Illustrated by new test case match-274.
In cases where a pattern has to be evaluated "the hard way" (using the logic described in the spec, rather than the right-to-left optimised evaluation) we aren't implementing the rule in the spec that an initial X step in the pattern matches
child-or-top::X rather than
child::X - that is, it should match an X element whether or not it has a parent.
Applies also to SaxonJS
Updated by Michael Kay about 2 years ago
- Status changed from New to In Progress
GeneralNodePattern so this test case now passes.
The logic is that when the search of the ancestor axis hits the root without finding a match, then if (a) the top-most node found was a parentless element, comment, text, or PI node, and (b) the "equivalent expression" starts with a child step, then the pattern matches provided (c) the node-test of the first step in the pattern matches the top-most element of the tree, and (d) the "rump" of the equivalent expression (that is, the expression minus its first step) selects the node being tested against the pattern.
Please register to edit this issue