Share via


Reading XML with the XmlReader

The XmlReader class is an abstract base class that provides non-cached, forward-only, read-only access to XML data. It conforms to the W3C Extensible Markup Language (XML) 1.0 and the Namespaces in XML recommendations.

The XmlReader class supports reading XML data from a stream or file. It defines methods and properties that allow you to move through the data and read the contents of a node. The current node refers to the node on which the reader is positioned. The reader is advanced using any of the read methods and properties return the value of the current node.

The XmlReader class enables you to:

  • Verify that the characters are legal XML characters, and that element and attribute names are valid XML names.

  • Verify that the XML document is well formed.

  • Validate the data against a DTD or schema.

  • Retrieve data from the XML stream or skip unwanted records using a pull model.

In This Section

See Also

Other Resources

XML Documents and Data