[Overview][Types][Classes][Procedures and functions][Index] Reference for unit 'Laz2_XPath' (#lazutils)

TXPathExpression.Evaluate

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

Declaration

Source position: laz2_xpath.pas line 460

public function TXPathExpression.Evaluate(

  AContextNode: TDOMNode

):TXPathVariable;

function TXPathExpression.Evaluate(

  AContextNode: TDOMNode;

  AEnvironment: TXPathEnvironment

):TXPathVariable;

Arguments

AContextNode

  

Context node for the expression.

Function result

Value from the evaluated expression.

Arguments

AContextNode

  

Context node for the expression.

AEnvironment

  

XPath environment for the evaluation.

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

TXPathEnvironment

  

Provides access to functions and variables available in the XPath environment.

TXPathScanner

  

Implements a lexical scanner and parser using XPath syntax and semantics.

TXPathVariable

  

Base class used to represent an XPath variables and results.

TXPathExprNode.Evaluate

  

Specifies the method used to evaluate an XPath Predicate Expression.


Version 4.0 Generated 2025-05-03 Home