Showing posts with label Reading and Writing XML. Show all posts
Showing posts with label Reading and Writing XML. Show all posts

Reading and Writing XML




Data Using XmlReader and

XmlWriter

One of the major features of the .NET Framework is that it enables you to easily produce distributed
applications that are language-independent, and that are platform-independent when .NET is
ported to other platforms. XML plays a major part in this plan by acting as a simple, portable glue
layer that is used to pass data around in distributed applications. Microsoft has XML-enabled many
parts of the .NET Framework and it is crucial for the developers to get an understanding of how to
work with XML data using the .NET Framework classes. This chapter discusses the different ways
of reading and writing XML data utilizing the System.Xml classes. Specifically, this chapter covers:

  XML reading and writing support provided by the .NET Framework 2.0

  How to parse an XML file using the XmlReader class

  How to parse the attributes and data contained in the XML file

  How to customize the settings of the XmlReader object through the use of the reusable

XmlReaderSettings class

  How to write to an XML file using the XmlWriter class

  How to customize the output produced by the XmlWriter object using the

XmlWriterSettings class

  How to write namespaces using the XmlWriter class

  How to embed images in an XML document using the XmlWriter class

The following section starts by discussing the different XML reader and writer classes in the .NET
Framework 2.0.

Reading and Writing XML

Chapter 4 starts a section of chapters (4 through 6) that look at the functionality contained within the
System.Xml in more detail.
In particular, here I look at the fast, forward-only read-only mechanisms provided by the .NET
Framework for reading and writing XML documents, namely the XmlReader and XmlWriter classes. I
explore the new XML reading and writing model and talk about the various ways using, which you can
read and write XML data. I also go onto discuss node order, parsing attributes, customizing reader and
writer settings, white spaces handling, and namespace handling, and other namespace support