XmlReader::Skip Method ()
Skips the children of the current node.
Assembly: System.Xml (in System.Xml.dll)
In the following XML input if the reader is positioned on the <a> node or any of its attributes, calling Skip positions the reader to the <b> node.
If the reader is positioned on a leaf node already (such as the <x> node or the text node abc), calling Skip is the same as calling Read.
<a name="bob" age="123"> <x/>abc<y/> </a> <b> ... </b>
This method checks for well-formed XML.
If the reader is an XmlValidatingReader, this method also validates the skipped content.
The XmlReader implementation determines whether or not the Skip method will expand external entities. The following table describes whether the external entities are expanded for the various types of XmlReader objects.
Type of XmlReader
Expands external entities
For the asynchronous version of this method, see SkipAsync.
The following example parses an XML file starting on the second book node.
The example uses the file, 2books.xml, as input.
Available since 8
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Available since 8.1