Preparation

We assume that you have a basic knowledge of programming with Microsoft's C# Programming Language and are familiar with the installation of the .NET software development kit. If you are not, check out an introductory C# .NET Book or visit the Microsoft .NET site at http://www.microsoft.com/net/.

In this chapter, various methods for working with XML in Microsoft's .NET framework are presented. Microsoft .NET is a new and exciting framework for application development. Because .NET is new, we will start with the preparation and prerequisites for .NET development, followed by an introduction to the .NET XML Framework concepts. Next, various methods of parsing XML are presented, including both a SAX-like and a DOM method. Support for XML in .NET is extensive. The .NET framework also includes built-in support for XPath navigation and XSLT Transformation, which are covered in the final sections of the chapter.

Make sure that the following software is installed on your machine:

  • The Microsoft .NET Platform SDK is available at http://msdn.microsoft.com/downloads/default.asp. All the libraries that will be used in this chapter are contained within the Microsoft .NET Platform SDK.

  • An Integrated Development Environment (IDE) is optional, but highly recommended. The premier IDE is Microsoft's Visual Studio .NET, which is a commercial product. More information is available at http://msdn.microsoft.com/vstudio/.

  • One great alternative is SharpDevelop, which is a free .NET Integrated Development Environment, made available under an open source license at http://www.icsharpcode.net/.

We will be using the following sample XML Document throughout this chapter:

<?xml version="1.0" ?> 
<!DOCTYPE net_xml [
  <!ELEMENT net_xml        (standards, parsers)>
  <!ELEMENT standards (standard)+>
  <!ELEMENT parsers (parser)+>
  <!ELEMENT parser (#PCDATA)>
  <!ELEMENT standard (#PCDATA)>
  <!ATTLIST parser
     href     CDATA    #REQUIRED
  >
  <!ATTLIST standard
     href     CDATA    #REQUIRED
  >
]>
<net_xml>
  <standards>
    <standard href="http://www.dotnetexperts.com/ecma/index.html">
      .NET Standards Documents
    </standard>
    <standard href="http://www.w3.org/DOM/">
      Document Object Model(DOM)
    </standard>
    <standard href="http://www.saxproject.org/">
      Simple API for XML(SAX)
    </standard>
  </standards>
  <parsers>
    <parser href="">
      XmlTextReader
    </parser>
    <parser href="">
      XmlNodeReader
    </parser>
    <parser href="">
      XmlValidatingReader
    </parser>
  </parsers>
</net_xml>
					

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.18.253