Interface IXPathResult
Namespace: Aspose.Html.Dom.XPath
Assembly: Aspose.HTML.dll (25.7.0)
The XPathResult interface represents the result of the evaluation of an
XPath 1.0 expression within the context of a particular node. Since evaluation
of an XPath expression can result in various result types, this object makes it
possible to discover and manipulate the type and value of the result.
[ComVisible(true)]
[DOMNoInterfaceObject]
public interface IXPathResultProperties
BooleanValue
The value of this boolean result.
[DOMName("booleanValue")]
bool BooleanValue { get; }Property Value
Exceptions
TYPE_ERR: raised if resultType is not
Boolean type.
InvalidIteratorState
Signifies that the iterator has become invalid. True if resultType
is UnorderedNodeIterator type or OrderedNodeIterator type and
the document has been modified since this result was returned.
[DOMName("invalidIteratorState")]
bool InvalidIteratorState { get; }Property Value
NumberValue
The value of this number result.
[DOMName("numberValue")]
double NumberValue { get; }Property Value
Exceptions
TYPE_ERR: raised if resultType is not
Number type.
ResultType
A code representing the type of this result, as defined by the http://www.w3.org/TR/DOM-Level-3-XPath/xpath.html#XPathResult Aspose.Html.Dom.XPath.XPathResultType enum.
[DOMName("resultType")]
XPathResultType ResultType { get; }Property Value
SingleNodeValue
The value of this single node result, which may be null.
[DOMName("singleNodeValue")]
[DOMNullable]
Node SingleNodeValue { get; }Property Value
Exceptions
TYPE_ERR: raised if resultType is not
AnyUnorderedNode type or FirstOrderedNode type.
SnapshotLength
The number of nodes in the result snapshot. Valid values for snapshotItem
indices are 0 to snapshotLength-1 inclusive.
[DOMName("snapshotLength")]
int SnapshotLength { get; }Property Value
Exceptions
TYPE_ERR: raised if resultType is not
UnorderedNodeSnapshot type or OrderedNodeSnapshot type.
StringValue
The value of this string result.
[DOMName("stringValue")]
string StringValue { get; }Property Value
Exceptions
TYPE_ERR: raised if resultType is not
String type.
Methods
IterateNext()
Iterates and returns the next node from the node set or null if there are no more nodes.
[DOMName("iterateNext")]
Node IterateNext()Returns
Returns the next node.
Exceptions
TYPE_ERR: raised if resultType is not
UnorderedNodeIterator type or OrderedNodeIterator type.
INVALID_STATE_ERR: The document has been mutated since the result was returned.
SnapshotItem(int)
Returns the indexth item in the snapshot collection. If index is greater than
or equal to the number of nodes in the list, this method returns null. Unlike the
iterator result, the snapshot does not become invalid, but may not correspond to the current
document if it is mutated.
[DOMName("snapshotItem")]
[DOMNullable]
Node SnapshotItem(int index)Parameters
index int
Index into the snapshot collection.
Returns
The node at the indexth position in the NodeList, or null if
that is not a valid index.
Exceptions
TYPE_ERR: raised if resultType is not
UnorderedNodeSnapshot type or OrderedNodeSnapshot type.