Namespace: xp

selblocks.xp

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.
Source:

(static) fmtXpathResultType()

Format an xpath result according to its data type
Source:

(static) foreachNode()

Operate on each node in the given snapshot object
Source:

(static) logXpathEval()

Log an xpath result
Source:

(static) selectElement()

Find the first matching element
Source:

(static) selectElements()

Find all matching elements TBD: make XPath engine choice configurable
Source:

(static) selectNode()

Select a single node (analogous to xpath[1], without the axis-precedence gotchas)
Source:

(static) selectNodes()

Select one or more nodes as an array
Source:

(static) selectNodeSnapshot()

Select all matching nodes in the document, as a snapshot object
Source:

(static) selectUniqueNodeNullable()

Select the exact matching node, else null
Source:

(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)
Source: