Table of Contents

Class XPathResult

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The XPathResult interface represents the results generated by evaluating an XPath expression within the context of a given node.

[Value("XPathResult")]
public class XPathResult
Inheritance
XPathResult
Inherited Members

Remarks

Since XPath expressions can result in a variety of result types, this interface makes it possible to determine and handle the type and value of the result.

-Document.Evaluate
-XPathExpression

See also on MDN

Constructors

XPathResult()

public XPathResult()

Fields

ANY_TYPE

[Value("ANY_TYPE")]
public const ushort ANY_TYPE = 0

Field Value

ushort

ANY_UNORDERED_NODE_TYPE

[Value("ANY_UNORDERED_NODE_TYPE")]
public const ushort ANY_UNORDERED_NODE_TYPE = 8

Field Value

ushort

BOOLEAN_TYPE

[Value("BOOLEAN_TYPE")]
public const ushort BOOLEAN_TYPE = 3

Field Value

ushort

FIRST_ORDERED_NODE_TYPE

[Value("FIRST_ORDERED_NODE_TYPE")]
public const ushort FIRST_ORDERED_NODE_TYPE = 9

Field Value

ushort

NUMBER_TYPE

[Value("NUMBER_TYPE")]
public const ushort NUMBER_TYPE = 1

Field Value

ushort

ORDERED_NODE_ITERATOR_TYPE

[Value("ORDERED_NODE_ITERATOR_TYPE")]
public const ushort ORDERED_NODE_ITERATOR_TYPE = 5

Field Value

ushort

ORDERED_NODE_SNAPSHOT_TYPE

[Value("ORDERED_NODE_SNAPSHOT_TYPE")]
public const ushort ORDERED_NODE_SNAPSHOT_TYPE = 7

Field Value

ushort

STRING_TYPE

[Value("STRING_TYPE")]
public const ushort STRING_TYPE = 2

Field Value

ushort

UNORDERED_NODE_ITERATOR_TYPE

[Value("UNORDERED_NODE_ITERATOR_TYPE")]
public const ushort UNORDERED_NODE_ITERATOR_TYPE = 4

Field Value

ushort

UNORDERED_NODE_SNAPSHOT_TYPE

[Value("UNORDERED_NODE_SNAPSHOT_TYPE")]
public const ushort UNORDERED_NODE_SNAPSHOT_TYPE = 6

Field Value

ushort

Properties

BooleanValue

The read-only booleanValue property of the
XPathResult interface returns the boolean value of a result with
ResultType being BOOLEAN_TYPE.

[Value("booleanValue")]
public bool BooleanValue { get; }

Property Value

bool

The return value is the boolean value of the XPathResult returned by
Document.Evaluate.

Remarks

InvalidIteratorState

The read-only invalidIteratorState property of the
XPathResult interface signifies that the iterator has become invalid. It
is true if ResultType is
UNORDERED_NODE_ITERATOR_TYPE or ORDERED_NODE_ITERATOR_TYPE and
the document has been modified since this result was returned.

[Value("invalidIteratorState")]
public bool InvalidIteratorState { get; }

Property Value

bool

A boolean value indicating whether the iterator has become invalid.

Remarks

NumberValue

The read-only numberValue property of the
XPathResult interface returns the numeric value of a result with
ResultType being NUMBER_TYPE.

[Value("numberValue")]
public double NumberValue { get; }

Property Value

double

The return value is the numeric value of the XPathResult returned by
Document.Evaluate.

Remarks

ResultType

The read-only resultType property of the
XPathResult interface represents the type of the result, as defined by
the type constants.

[Value("resultType")]
public ushort ResultType { get; }

Property Value

ushort

An integer value representing the type of the result, as defined by the type constants.

Remarks

SingleNodeValue

The read-only singleNodeValue property of the
XPathResult interface returns a Node value or
null in case no node was matched of a result with
ResultType being ANY_UNORDERED_NODE_TYPE or
FIRST_ORDERED_NODE_TYPE.

[Value("singleNodeValue")]
public Node? SingleNodeValue { get; }

Property Value

Node

The return value is the Node value of the XPathResult
returned by Document.Evaluate.

Remarks

SnapshotLength

The read-only snapshotLength property of the
XPathResult interface represents the number of nodes in the result
snapshot.

[Value("snapshotLength")]
public ulong SnapshotLength { get; }

Property Value

ulong

An integer value representing the number of nodes in the result snapshot.

Remarks

StringValue

The read-only stringValue property of the
XPathResult interface returns the string value of a result with
ResultType being STRING_TYPE.

[Value("stringValue")]
public string StringValue { get; }

Property Value

string

The return value is the string value of the XPathResult returned by
Document.Evaluate.

Remarks

Methods

IterateNext()

The iterateNext() method of the
XPathResult interface iterates over a node set result and returns the
next node from it or null if there are no more nodes.

[Value("iterateNext")]
public Node? IterateNext()

Returns

Node

The next Node within the node set of the XPathResult.

Remarks

SnapshotItem(ulong)

The snapshotItem() method of the
XPathResult interface returns an item of the snapshot collection or
null in case the index is not within the range of nodes. Unlike the
iterator result, the snapshot does not become invalid, but may not correspond to the
current document if it is mutated.

[Value("snapshotItem")]
public Node? SnapshotItem(ulong index)

Parameters

index ulong

Returns

Node

The Node at the given index within the node set of the
XPathResult.

Remarks