Implement XQuery 4.0 axes and fix preceding/following axis predicate bug#6209
Open
joewiz wants to merge 1 commit intoeXist-db:developfrom
Open
Implement XQuery 4.0 axes and fix preceding/following axis predicate bug#6209joewiz wants to merge 1 commit intoeXist-db:developfrom
joewiz wants to merge 1 commit intoeXist-db:developfrom
Conversation
This was referenced Apr 6, 2026
Add 4 new XPath axes from the XQuery 4.0 specification: - following-or-self: self + following (forward axis) - following-sibling-or-self: self + following-sibling (forward axis) - preceding-or-self: self + preceding (reverse axis) - preceding-sibling-or-self: self + preceding-sibling (reverse axis) These convenience axes combine existing axes with self, avoiding verbose union patterns like (self::node() | following-sibling::node()). Implementation evaluates as union of self + base axis results, preserving document order. Changes: - Constants.java: 4 new axis constants (14-17) - XQuery.g: axis names in forward/reverse specifiers + reserved keywords - XQueryTree.g: axis name to constant mapping - LocationStep.java: getOrSelfAxis() dispatch method - Predicate.java: reverse axis detection for new axes 8/8 JUnit tests pass, 148 XPath tests pass (0 regressions). Spec: https://qt4cg.org/specifications/xquery-40/xpath-40-xquery-40.html#axes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
Author
|
[This response was co-authored with Claude Code. -Joe] CI state: 7/9 checks pass. The 2 remaining failures (windows and macOS integration) are pre-existing test hangs unrelated to this PR. Dependencies: None. This PR is Wave 1 — it can be reviewed and merged independently. For full context on all 7.0 PRs and the merge order, see the Reviewer Guide. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds XQuery 4.0 axis support and fixes a pre-existing axes bug. Includes commit from PR #6076 (approved by @duncdrum). Also creates
XQuery4Tests.javatest runner for thexquery4/test directory.What Changed
ancestor-or-self-or-self,descendant-or-self-or-self,following-or-self,preceding-or-selfXQuery4Tests.javarunner forsrc/test/xquery/xquery4/directorySpec References
Tests
Supersedes
Test plan
🤖 Generated with Claude Code