XPathEvaluator Class

https://dom.spec.whatwg.org/#interface-xpathevaluator

public sealed class XPathEvaluator

Constructors

NameDescription
XPathEvaluator()Creates an evaluator.

XPathEvaluator()

XPathApi.cs

Creates an evaluator.

public XPathEvaluator()

Methods

NameDescription
CreateExpression(string, IXPathNSResolver?)Compiles the XPath expression, using the optional resolver for its namespace prefixes.
CreateNSResolver(Node)Returns a namespace resolver for the given node, which is the node itself.
Evaluate(string, Node, IXPathNSResolver?, ushort, XPathResult?)Evaluates the XPath expression against the context node and returns the result, of the requested type.

CreateExpression(string, IXPathNSResolver?)

XPathApi.cs

Compiles the XPath expression, using the optional resolver for its namespace prefixes.

public XPathExpression CreateExpression(string expression, IXPathNSResolver? resolver = null)

CreateNSResolver(Node)

XPathApi.cs

Returns a namespace resolver for the given node, which is the node itself.

public Node CreateNSResolver(Node nodeResolver)

Evaluate(string, Node, IXPathNSResolver?, ushort, XPathResult?)

XPathApi.cs

Evaluates the XPath expression against the context node and returns the result, of the requested type.

public XPathResult Evaluate(string expression, Node contextNode, IXPathNSResolver? resolver = null, ushort type = 0, XPathResult? result = null)