Overview of the XML Classes


The .NET framework contains a rich set of classes for working with XML data; these classes are divided into multiple namespaces. This book does not cover all these classes; however, I want to provide you with an overview of the most important ones.

The main classes for working with XML data are as follows :

  • XmlTextReader ” This class provides fast, forward-only access to the raw data contained in an XML file. It parses XML data into tokens, but it does not represent the XML data in an object model such as the W3C XML Document Object Model (DOM).

  • XmlTextWriter ” This class provides a fast, forward-only method to write data to an XML file. It ensures that the data written to the file conforms to the W3C XML 1.0 standard.

  • XmlDocument ” This class represents XML using the W3C XML DOM levels 1 and 2. You can use this class to both navigate and edit the nodes in an XML document tree.

  • XmlDataDocument ” This class enables you to represent both XML and relational data in W3C XML DOM levels 1 and 2. You can use this class with a DataSet to provide both relational and non-relational views of the same underlying data.

  • XmlNodeReader ” This class provides fast, forward-only access to data represented by the XmlDocument or XmlDataDocument class.

  • DocumentNavigator ” This class enables you to efficiently navigate an XML document represented by the XmlDocument class. It supports the XPath data model for navigation.

  • DataDocumentNavigator ” This class enables you to efficiently navigate an XML document represented by the XmlDataDocument class. It supports the XPath data model for navigation.

  • XslTransform ” This class enables you to transform an XML document with XSL stylesheets. It supports XSLT 1.0 stylesheet syntax.

These XML classes can be roughly divided into four types. The first two classes, XmlTextReader and XmlTextWriter , enable you to perform the basic operations of reading and writing XML data to a file.

If you need to represent XML data in a static, memory-resident structure, you use either the XmlDocument or XmlDataDocument class. These classes enable you to create an XML DOM to represent an XML document in a memory-resident tree.

NOTE

To learn more details about the XML Document Object Model (DOM), visit the World Wide Web Consortium (W3C) Web site at http://www.w3.org/dom.


The XmlDocument class enables you to represent XML data in a DOM. XmlDataDocument extends the XmlDocument class to enable you to represent the XML data in either a DOM or a DataSet .

If you want to efficiently navigate the nodes of an XML document represented by the XmlDocument or XmlDataDocument class, you can use the XmlNodeReader , DocumentNavigator , or DataDocumentNavigator class. The latter two classes support XPath expressions.

Finally, the XslTransform class enables you to perform transformations on an XML document. Typically, you use the XslTransform class either to convert one XML document into another XML document or to convert an XML document into an HTML document. However, you also can use the XslTransform class to convert an XML document into any other file format.

NOTE

To learn more details about XSL (eXtensible Stylesheet Language), visit the W3C Web site at http://www.w3.org/style/xsl.




ASP.NET Unleashed
ASP.NET 4 Unleashed
ISBN: 0672331128
EAN: 2147483647
Year: 2003
Pages: 263

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net