Methods
(static) evaluateXpath()
Evaluate an xpathExpression against the given document object.
The document is also the starting context, unless a contextNode is provided.
Results are in terms of the most natural type, unless resultType specified.
(static) fmtXpathResultType()
Format an xpath result according to its data type
(static) foreachNode()
Operate on each node in the given snapshot object
(static) logXpathEval()
Log an xpath result
(static) selectElement()
Find the first matching element
(static) selectElements()
Find all matching elements
TBD: make XPath engine choice configurable
(static) selectNode()
Select a single node
(analogous to xpath[1], without the axis-precedence gotchas)
(static) selectNodes()
Select one or more nodes as an array
(static) selectNodeSnapshot()
Select all matching nodes in the document, as a snapshot object
(static) selectUniqueNodeNullable()
Select the exact matching node, else null
(static) selectValue()
Select matching node as string/number/boolean value
TBD: Exclude the text of certain node types (eg, script).
A way to filter would be to add "//*[not(self::script)]/text()[normalize-space(.)!='']"
But that yields a node set and XPath stringify operations only use the first node in a node set.
Other invisibles: //*[contains(translate(@style,' ',''),'display:none') or contains(translate(@style,' ',''),'visibility:hidden')]
(for inline styling at least, cascaded styling is not accessible via XPath)