XPathNavigator.HasChildren Property

Definition

Gets a value that indicates whether the current node has any child nodes.

public:
 virtual property bool HasChildren { bool get(); };
public:
 abstract property bool HasChildren { bool get(); };
public virtual bool HasChildren { get; }
public abstract bool HasChildren { get; }
member this.HasChildren : bool
Public Overridable ReadOnly Property HasChildren As Boolean
Public MustOverride ReadOnly Property HasChildren As Boolean

Property Value

true if the current node has any child nodes; otherwise, false.

Remarks

If the XPathNavigator is positioned on a node that cannot have child nodes, the HasChildren property always returns false.

The following table lists the child node XPathNodeType nodes allowed for each XPathNodeType node.

XPathNodeType Node Child XPathNodeType Nodes
Root Element, Comment, or ProcessingInstruction nodes. Note: DocumentFragment is equivalent to Root when using the XmlDocument class and can have the same children as an element.
Element Element, Text, Comment, ProcessingInstruction, Whitespace or SignificantWhitespace nodes.
All other XPathNodeType nodes Cannot have child nodes.

Applies to

See also