System.Xml.XmlReader.MoveToContent Method

Checks whether the current node is a content (non-white space text, CDATA, Element, EndElement, EntityReference, or EndEntity) node. If the node is not a content node, the reader skips ahead to the next content node or end of file. It skips over nodes of the following type: ProcessingInstruction, DocumentType, Comment, Whitespace, or SignificantWhitespace.

Syntax

public virtual XmlNodeType MoveToContent ()

Returns

The XmlReader.NodeType of the current node found by the method or XmlNodeType.None if the reader has reached the end of the input stream.

Exceptions

TypeReason
System.Xml.XmlExceptionAn error occurred while parsing the XML.

Remarks

If the current node is an attribute node, this method moves the reader back to the element that owns the attribute.

For the asynchronous version of this method, see XmlReader.MoveToContentAsync.

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0