Check whether an item matches an XPath expression.
Check whether an item matches an XPath expression.
Use to filter nodes when comparing XML trees.
Example:
"Ignore an attribute" >> { applying(<x/>) must produce(<y/>)(filterAttr(!XPath.matches("@id", _))) }
Evaluate the given XPath query on the given context item.
Evaluate the given XPath query on the given context item.
Note: this method isn't suitable for dealing with atomic values, since it's set to always return a node.
The primary use case is to test XSLT templates that access nodes outside the current node. This is subject to change.
Example:
"Apply a template that accesses an ancestor node" in { applying { // The ancestor element is set as the context node for the transformation. <ancestor copied="value"><descendant/></ancestor>, // Use XPath to select the element that you want to apply the templates for. XPath.select("ancestor/descendant") } must produce (<descendant copied="value"/>) }