Using the XmlReader
The .NET Framework provides three implementations of
XmlNodeReader. In this section,
I’ll present each class one at a time and show you
how to use them.
is the most immediately
useful specialization of
XmlTextReader is used to read XML from a
TextReader. You can use it to read XML from a text
file on disk, from a web site, or from a string in memory that has
been built or loaded elsewhere in your program.
XmlTextReader does not validate the XML it reads;
however, it does expand the general entities
& into their text representations
&, respectively), and it does check the XML
In addition to these general
XmlTextReader can resolve system-
and user-defined entities, and can be optimized somewhat by providing
it with an
XmlNameTable is an abstract class, you can
instantiate a new
NameTable, or access an
XmlNameTable through its
XmlNameTable contains a collection of string
objects that are used to represent the elements and attributes of an
XmlReader can use this table to more
efficiently handle elements and attributes that recur in a document.
XmlNameTable object is created at runtime by the .NET parser every time it reads an XML document. If you are parsing many documents with the same format, using ...