Skip to content

Implement XQuery 4.0 axes and fix preceding/following axis predicate bug#6209

Open
joewiz wants to merge 1 commit intoeXist-db:developfrom
joewiz:v2/xq4-axes
Open

Implement XQuery 4.0 axes and fix preceding/following axis predicate bug#6209
joewiz wants to merge 1 commit intoeXist-db:developfrom
joewiz:v2/xq4-axes

Conversation

@joewiz
Copy link
Copy Markdown
Member

@joewiz joewiz commented Apr 6, 2026

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.java test runner for the xquery4/ test directory.

What Changed

Spec References

Tests

  • exist-core: 6,563 run, 0 failures, 0 errors
  • Codacy: 0 new issues

Supersedes

Test plan

  • exist-core unit tests pass (6,563 run, 0 failures)
  • XQ4 axes tests pass (xq4-axes.xql)
  • XQ4 axes JUnit tests pass (XQ4AxesTest)

🤖 Generated with Claude Code

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>
@joewiz joewiz marked this pull request as ready for review April 14, 2026 13:43
@joewiz joewiz requested a review from a team as a code owner April 14, 2026 13:43
@joewiz
Copy link
Copy Markdown
Member Author

joewiz commented Apr 14, 2026

[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.

@duncdrum duncdrum added enhancement new features, suggestions, etc. xquery issue is related to xquery implementation XQ4 xquery 4 labels Apr 14, 2026
@duncdrum duncdrum added this to v7.0.0 Apr 14, 2026
@duncdrum duncdrum added this to the eXist-7.0.0 milestone Apr 14, 2026
@duncdrum duncdrum moved this to Ready in v7.0.0 Apr 14, 2026
@duncdrum duncdrum moved this from Ready to Backlog in v7.0.0 Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement new features, suggestions, etc. XQ4 xquery 4 xquery issue is related to xquery implementation

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants