TAP5-2827: tapestry-core DOM XPath support#59
Merged
Conversation
thiagohp
approved these changes
Jun 22, 2026
benweidig
added a commit
that referenced
this pull request
Jun 27, 2026
Introduces a Jaxen-based XPath engine for querying Tapestry's DOM tree. New API: - `XPath` (org.apache.tapestry5.dom.xpath): factory-style entry point for compiling and executing XPath expressions against a Document or Node context - `BoundXPath` (org.apache.tapestry5.dom): fluent wrapper returned by Node#xpath(String) that binds an expression to a context node, avoiding repetition of the context in chained calls - `DocumentNavigator`: Jaxen Navigator implementation that adapts Tapestry's DOM node types (Element, Text, CData, Comment, Raw) to the Jaxen model - `NodeVisitor`: new visitor interface used internally by DocumentNavigator - `XPathException`: unchecked exception wrapping Jaxen errors Existing DOM classes were extended to support the navigator and expose the new xpath(String) entry point.
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.
Adds XPath support to tapestry-core DOM nodes.
It's based on Jaxen 2, and provides either using it similar to tapestr-xpath, by providing the Nodes to an XPath, but also creating an already BoundXPath from a DOM node.