Skips the children of the current node.
Assemblies: System.Xml (in System.Xml.dll)
System.Xml.ReaderWriter (in System.Xml.ReaderWriter.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.