Skip to content

TAP5-2827: tapestry-core DOM XPath support#59

Merged
benweidig merged 2 commits into
apache:masterfrom
benweidig:master
Jun 27, 2026
Merged

TAP5-2827: tapestry-core DOM XPath support#59
benweidig merged 2 commits into
apache:masterfrom
benweidig:master

Conversation

@benweidig

Copy link
Copy Markdown
Contributor

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.

@benweidig benweidig merged commit 0134cde into apache:master Jun 27, 2026
2 checks passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants