Sign in Join
FPDoc Onlineexperiment

TXPathExpression.Evaluate function

Member of TXPathExpressionpublicIn unit Laz2_XPath

Evaluates an XPath expression using the scanner for the class instance with the specified context node and XPath environment.

Declaration

pascal
function Evaluate(AContextNode: TDOMNode): TXPathVariable
function Evaluate(AContextNode: TDOMNode; 
 AEnvironment: TXPathEnvironment): TXPathVariable

Arguments

AContextNode

Context node for the expression.

AEnvironment

XPath environment for the evaluation.

Function result

Value from the evaluated expression.

Description

Evaluate is an overloaded method in TXPathExpression used to select node(s) or value(s) in the specified context which match an XPath expression. It returns a TXPathVariable type which contains the node(s) or value(s) which match the expression used in the XPath scanner for the class instance.

An overloaded variant allows the XPath environment to be provided during expression evaluation. The TXPathEnvironment argument allows variable names, variable values, and functions to be added to or removed from the execution environment. It also provides an implementation of the core functions in the XPath function library.

Evaluate iteratively calls the Evaluate method for nodes in the root context to capture the return value for the method.

No actions are performed in the method if a root node has not been assigned in the XPath scanner. In this situation, the return value is Nil.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.