Using System.Xml Classes


If you have done any work with MSXML 3.0 or 4.0, the preceding code 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?

Although 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.

Note that the books.xml file is used for several examples in this chapter, and the code sample you just looked at is the basis for many examples, too.




Professional C# 2005 with .NET 3.0
Professional C# 2005 with .NET 3.0
ISBN: 470124725
EAN: N/A
Year: 2007
Pages: 427

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