Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

5.3. Reading XML

The counterpart to XmlWriter is XmlReader. Although logically it’s the inverse of XmlWriter, XmlReader is slightly more complex; it has almost twice as many public properties and methods. A lot of these are to allow you to read typed data from an XML file.

5.3.1. XMLReader

XmlReader is usually instantiated in the same way as XmlWriter—through the static Create method. There’s a plethora of different overloads for creating new instances; you can supply a stream, TextReader, or a resource locator as a string. You can also optionally pass in XmlReaderSettings and an XmlParserContext, and just about any combination of these items.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial