See Also: XmlReader Members
This class provides forward-only, read-only access to a stream of XML data. This class enforces the rules of well-formed XML but does not perform data validation.
This class conforms to the W3C Extensible Markup Language (XML) 1.0 and the Namespaces in XML recommendations.
A given set of XML data is modeled as a tree of nodes. The different types of nodes are specified in the System.Xml.XmlNodeType enumeration. The reader is advanced to the next node using the XmlReader.Read method. The current node refers to the node on which the reader is positioned. The following table lists the node properties exposed for the current node.
| Property | Description |
|---|---|
| AttributeCount | The number of attributes on the node. |
| BaseUri | The base URI of the node. |
| Depth | The depth of the node in the tree. |
| HasAttributes | Whether the node has attributes. |
| HasValue | Whether the node can have a text value. |
| IsDefault | Whether an Attribute node was generated from the default value defined in the DTD or schema. |
| IsEmptyElement | Whether an Element node is empty. |
| LocalName | The local name of the node. |
| Name | The qualified name of the node, equal to Prefix:LocalName. |
| NamespaceUri | The URI defining the namespace associated with the node. |
| NodeType | The System.Xml.XmlNodeType of the node. |
| Prefix | A shorthand reference to the namespace associated with the node. |
| QuoteChar | The quotation mark character used to enclose the value of an attribute. |
| Value | The text value of the node. |
| XmlLang | The xml:lang scope within which the node resides. |
This class does not expand default attributes or general entities. Any general entities encountered are returned as a single empty EntityReference node.
This class checks that a Document Type Definition (DTD) is well-formed, but does not validate using the DTD.
To read strongly typed data, use the System.Xml.XmlConvert class.
This class throws a System.Xml.XmlException on XML parse errors. After an exception is thrown, the state of the reader is not predictable. For example, the reported node type might be different than the actual node type of the current node.
This class is abstract and implemented in the System.Xml.XmlTextReader class.