Skip to Content
.NET & XML
book

.NET & XML

by Niel M. Bornstein
November 2003
Intermediate to advanced
476 pages
14h 38m
English
O'Reilly Media, Inc.
Content preview from .NET & XML

Chapter 2. Reading XML

Perhaps the simplest thing you can do with an existing XML document is to read it into memory. The .NET Framework provides a set of tools in the System.Xml namespace to help you read XML, whether you wish to deal with it as a stream of events or to load the data into your own data structures. In this chapter we take a look at XmlReader, its subclasses, and the associated .NET types and interfaces. I also discuss when it is appropriate to use the XmlReader instead of other methods of reading XML, and describe the differences between pull parsers and push parsers.

You can read XML from a local file or from a remote source over a network. You’ll see how to deal with various local and remote inputs, including reading through a network proxy. And you’ll learn how to validate an XML document regardless of which sort of input source is used.

Throughout this chapter, I make use of a hypothetical Angus Hardware purchase order in XML and do some simple processing of its contents.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Applied XML Programming for Microsoft® .NET

Applied XML Programming for Microsoft® .NET

Dino Esposito
XML Hacks

XML Hacks

Michael Fitzgerald

Publisher Resources

ISBN: 0596003978Supplemental ContentErrata