Working with the XmlTextReader


Working with the XmlTextReader

The XmlTextReader is a fast, forward-only, read-only XML parser. Since the XmlTextReader is a forward-only reader, very little data is cached while parsing the XML stream. This allows for the XmlTextReader to parse a document while using a small footprint. The XmlTextReader does not provide any validation beyond checking the well- formedness of the XML. Since no validation is performed while reading the document, the XmlTextReader provides fast XML parsing.

The XmlTextReader throws an XmlException if it encounters an error parsing the XML stream. Although this allows you to catch the exception and continue parsing, this is not recommended. The state of the XmlTextReader is unpredictable after it has thrown an XmlException .

The desktop .NET Framework's implementation of the XmlTextReader checks the well-formedness of the DocumentType nodes but does not validate the document using the Document Type Definition (DTD). The .NET Compact Framework enforces an even stricter rule: Documents with DocumentType nodes cannot be processed by the XmlTextReader ; the XmlTextReader will throw an XmlException if it encounters a DocumentType node while parsing.



Microsoft.NET Compact Framework Kick Start
Microsoft .NET Compact Framework Kick Start
ISBN: 0672325705
EAN: 2147483647
Year: 2003
Pages: 206

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net