Reads an XmlNode from the input stream.
[Visual Basic] Overridable Public Function ReadNode() As XmlNode [C#] public virtual XmlNode ReadNode(); [C++] public: virtual XmlNode* ReadNode(); [JScript] public function ReadNode() : XmlNode;
An XmlNode that corresponds to the current node.
Exception Type | Condition |
---|---|
XmlException | If incorrect XML is encountered in the input stream. |
This method creates an returns an XmlNode instance that corresponds to the to the current node and advances the reader to the next node in the input stream. If the reader is positioned at the beginning of the input stream, the BOF node is first skipped.
NodeType | Return value |
---|---|
StartTag | An XmlElement node. |
EndTag | A null reference. |
Text | An XmlText node. |
CData | An XmlCData node. |
Comment | An XmlComment node. |
PI | An XmlPI node. |
Header | An XmlHeader node. |
DocType | An XmlDocType node. |
EOF | A null reference. |
When the reader is positioned on a start tag, the ReadNode method reads all XML content up to and including the corresponding end tag. For example, if ReadNode is called when the reader is positioned on the
the reader will be positioned on the
See Also
XmlReader Class | XmlReader Members | System.Xml Namespace | Read | SkipNode