Using System.Xml Classes

 
Chapter 11 - Manipulating XML
bySimon Robinsonet al.
Wrox Press 2002
  

If you have done any work with MSXML 3.0 or 4.0, the code above will look pretty familiar. So why would you want to do this if the .NET Framework is supposed to have all of these wonderful XML classes to use?

While the System.Xml namespace is powerful and relatively easy to use, it is different from the MSXML 3.0 model. If you are comfortable using MSXML 3.0, then use it until you become familiar with the System.Xml namespace.

However, System.Xml classes have several advantages over MSXML classes. First, System.Xml is managed code, so by using it you will gain all of the code security and type safety of using managed code. Also, using COM interop incurs some overhead. Most importantly, however, the System.Xml namespace is easy to use and offers a great deal of flexibility. By the end of this chapter this will have become very evident to you.

You should note that we will be using the books.xml file for several examples in the chapter, and the code sample we just looked at will be the basis for many examples too.

  


Professional C#. 2nd Edition
Performance Consulting: A Practical Guide for HR and Learning Professionals
ISBN: 1576754359
EAN: 2147483647
Year: 2002
Pages: 244

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