System.Xml namespace comprises the following namespaces and core classes:
XslCompiledTransform) for performing (W3C) XSLT transformations of XML
W3C is an abbreviation for World Wide Web Consortium, where the XML standards are defined.
XmlConvert, the static class for parsing and formatting XML strings, is covered in Chapter 6.
XmlReader is a high-performance class for reading an XML stream in a low-level, forward-only manner.
Consider the following XML file:
<?xml version="1.0" encoding="utf-8" standalone="yes"?> <customer id="123" status="archived"> <firstname>Jim</firstname> <lastname>Bo</lastname> </customer>
To instantiate an
XmlReader, you call the static
XmlReader.Create method, passing in a
TextReader, or a URI string. For example:
using (XmlReader reader = XmlReader.Create ("customer.xml")) ...
XmlReader lets you read from potentially slow sources (
Streams and URIs), it offers asynchronous versions of most of its methods so that ...