[bugfix] Find processing instructions on the sibling axes of stored documents - #6767
Merged
Merged
Conversation
…ocuments LocationStep.getSiblings handed processing-instruction tests to a VirtualNodeSet, which found no sibling processing instructions at all, so preceding-sibling::processing-instruction() and following-sibling::processing-instruction() never matched on stored documents. They are now matched while streaming the siblings, as wildcard tests are; both TypeTest and NameTest already match processing instructions on the stream. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
📊 XQTS result comparisonComparison of this run against
Relative to 🔴 Newly failing tests (1)
🟢 Newly passing tests (3)
Runtime: 410.6s (-39.38s vs |
This was referenced Sep 25, 2026
dizzzz
approved these changes
Sep 28, 2026
duncdrum
approved these changes
Sep 29, 2026
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.
[This PR was prompted by Joe, drafted by Claude Code, and reviewed by Joe.]
Summary
On a stored document, a processing-instruction test on the
preceding-siblingorfollowing-siblingaxis never matches anything:preceding-sibling::node()on the same document does return the processing instructions, and constructed documents are unaffected.Cause
LocationStep.getSiblingshanded processing-instruction tests to aVirtualNodeSet, which does not produce siblings for them. A wildcard test on the same axes is matched while streaming the siblings, and bothTypeTestandNameTestalready match processing instructions on the stream, target name included. So processing-instruction tests now take that path too.This is the sibling-axis counterpart of 61702d1, which fixed the same
VirtualNodeSethand-off on the self axis.What Changed
LocationStep.getSiblingssibling-axis-processing-instructions.xqm(new XQSuite)Related issues and PRs
self::attribute(NAME)is always false on attributes of persistent nodes #6689) fixed the sameVirtualNodeSethand-off for processing-instruction tests on the self axis, in 61702d1. This PR is its counterpart on the sibling axes.getSiblings, but a different branch of it, and the two merge cleanly.How this was found
Running the W3C XQuery Update tests against stored documents, which the XQTS runner can now do (eXist-db/exist-xqts-runner#82), showed
complex-renames-q1andcomplex-replacevalues-q3failing only on stored documents. Neither failure was in the update: the verification query'spreceding-sibling::processing-instruction()found nothing even before any update. The context is summarized on #6214. BaseX 12.4 gives the expected result for each case above against a stored database.Test Plan
sibling-axis-processing-instructions.xqm: all pass with the fix; the stored-document tests fail without itxquery.CoreTests🤖 Generated with Claude Code