Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
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.
Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Syntax
'Declaration
Public Overridable Function MoveToContent As XmlNodeType
public virtual XmlNodeType MoveToContent()
public:
virtual XmlNodeType MoveToContent()
abstract MoveToContent : unit -> XmlNodeType
override MoveToContent : unit -> XmlNodeType
public function MoveToContent() : XmlNodeType
Return Value
Type: System.Xml. . :: . .XmlNodeType
The NodeType of the current node found by the method or XmlNodeType.None if the reader has reached the end of the input stream.
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 MoveToContentAsync.
Examples
This is useful when you want to write code that can skip over random XML markup without breaking. For example, suppose you have the following code:
This code can handle the following inputs without breaking:
<price>123.4</price>
and
<?xml version="1.0"><!DOCTYPE price SYSTEM
"abc"><price>123.4</price>
and
<?xml version="1.0"><!DOCTYPE price SYSTEM "abc"
[<!ENTTIY p
"123.4">]><price>&p;</price>
and
<!-- some test comment --><?processing
instruction?><price>123.4</price>
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.