Reads an XML document from this reader.
[Visual Basic] Public Function ReadDocument() As XmlDocument [C#] public XmlDocument ReadDocument(); [C++] public: XmlDocument* ReadDocument(); [JScript] public function ReadDocument() : XmlDocument;
An XmlDocument instance.
Exception Type | Condition |
---|---|
XmlException | If incorrect XML is encountered in the input stream. |
This method is typically invoked immediately after the reader has been created (i.e. when the reader is positioned on the first node in the input stream). The method creates a new XmlDocument instance and repeatedly calls ReadNode until an end tag or the end of the input stream is reached. As the nodes are read, they are added to the document's child node list.
XmlReader Class | XmlReader Members | System.Xml Namespace | ReadNode