NodeIterator Class

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

public sealed class NodeIterator

Properties

NameDescription
FilterGets the filter used to accept, reject or skip nodes, or null when there is none.
PointerBeforeReferenceNodeGets a value indicating whether the iterator is positioned before the reference node.
ReferenceNodeGets the node the iterator is currently positioned at.
RootGets the root node of the traversal.
WhatToShowGets the bit mask of the node types the iterator presents.

Gets the filter used to accept, reject or skip nodes, or null when there is none.

public INodeFilter? Filter { get; }

PointerBeforeReferenceNode

NodeIterator.cs

Gets a value indicating whether the iterator is positioned before the reference node.

public bool PointerBeforeReferenceNode { get; }

ReferenceNode

NodeIterator.cs

Gets the node the iterator is currently positioned at.

public Node ReferenceNode { get; }

Gets the root node of the traversal.

public Node Root { get; }

WhatToShow

NodeIterator.cs

Gets the bit mask of the node types the iterator presents.

public uint WhatToShow { get; }

Methods

NameDescription
Detach()Does nothing (https://dom.spec.whatwg.org/#dom-nodeiterator-detach).
NextNode()Moves the iterator to the next accepted node and returns it, or null when there is none.
PreviousNode()Moves the iterator to the previous accepted node and returns it, or null when there is none.

Does nothing (https://dom.spec.whatwg.org/#dom-nodeiterator-detach).

public void Detach()

NextNode()

NodeIterator.cs

Moves the iterator to the next accepted node and returns it, or null when there is none.

public Node? NextNode()

PreviousNode()

NodeIterator.cs

Moves the iterator to the previous accepted node and returns it, or null when there is none.

public Node? PreviousNode()