Mono Class Library: System.Xml Namespace

System.Xml.XmlTextReader Class

Represents a reader that provides fast, non-cached, forward-only access to XML data. [Edit]

See Also: XmlTextReader Members

System.Object
     System.Xml.XmlReader
          System.Xml.XmlTextReader

public class XmlTextReader : XmlReader, Mono.Xml.IHasXmlParserContext, IXmlLineInfo, IXmlNamespaceResolver

Thread Safety

All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.

Remarks

This class provides forward-only, read-only access to a character stream of XML data. This class enforces the rules of well-formed XML but does not perform data validation.

This class implements the System.Xml.XmlReader class and 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 current node refers to the node on which the reader is positioned. The reader is advanced using any of the "read" or "moveto" methods. The following table lists the node properties exposed for the current node.

PropertyDescription
AttributeCount The number of attributes on the node.
BaseUriThe base URI of the node.
DepthThe depth of the node in the tree.
HasAttributesWhether the node has attributes. (Inherited from System.Xml.XmlReader)
HasValueWhether the node can have a text value.
IsDefaultWhether an Attribute node was generated from the default value defined in the DTD or schema.
IsEmptyElementWhether an Element node is empty.
LocalNameThe local name of the node.
NameThe qualified name of the node, equal to Prefix:LocalName .
NamespaceUriThe URI defining the namespace associated with the node.
NodeTypeThe System.Xml.XmlNodeType of the node.
PrefixA shorthand reference to the namespace associated with the node.
QuoteCharThe quotation mark character used to enclose the value of an attribute.
ValueThe text value of the node.
XmlLangThe xml:lang scope within which the node resides.

This class does not expand default attributes or resolve 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 can be different than the actual node type of the current node.

[Edit]

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0