Library tutorials & articles
What's new in System.Xml 2.0
- Introduction, XML readers & writers
- XML Document Stores and Navigators
- Working with XML Schemas
XML Document Stores and Navigators
Version 1.x supports three XML document stores:
the XmlDocument, XmlDataDocument and XPathDocument. Each has different
features, for example the XmlDocument supports the W3C standards for
XML document management (the XML DOM model), plus useful additional
features that make it easier to access the contents. The
XmlDataDocument is designed to provide a bridge between XML and
relational data by allowing the content to be accessed as a DataSet
instance as well as a standard XML document. The XPathDocument is a
fast and efficient document store designed to be accessed only using
XPath methods and the XPathNavigator (although the XPathNavigator can
be used over any of the three document stores).
In version 2.0, Microsoft has attempted to simplify the model and
remove confusion over which document store to use. The primary XML
document store is now XmlDocument, which supports both the W3C model
and the use of the XPathNavigator. However, in addition, many
enhancements have been made to this combination of classes. In
particular, they now provide a read/write cursor-style API for editing
the contents of the document. You can also create XmlReader and
XmlWriter instances located at a node in the document, and use them to
read from or write content into the document. Furthermore, the
XmlDocument and XPathNavigator combination also supports the reading
and writing of XML as CLR data types.
Other new features in the XmlDocument class are the ability to
validate the content before and after editing without having to reload
it through a reader instance (as was necessary in version 1.x), and new methods such as ReadSubtree and WriteSubtree that make it easy to move sections of XML between separate documents.
Meanwhile, the XPathDocument continues as a high performance,
read-only document store that can only be accessed using an
XPathNavigator - in much the same way as in version 1.x. However, it
has been optimized for XPath queries and XSLT transformations, and
should be chosen where possible if this type of operation is being
carried out.
Related articles
Related discussion
-
Creating a Windows Service in VB.NET
by davidvanr (108 replies)
-
Nesting tables in a dataset
by Peterb74 (1 replies)
-
Nesting tables in a dataset
by Peterb74 (0 replies)
-
HL7 requirement - Urgent
by Akhil_Kothari (1 replies)
-
write to XML file vb.net
by acnetonline (2 replies)
Related podcasts
-
Episode 10: LINQ
K Scott leads us in a discussion of LINQ, including: What is it How introducing LINQ to .NET changed the framework LINQ Providers LINQ to XML LINQ to SQL - how it's different from EF, tips and tricks, when to use it Links: LINQpad 3rd Party LIN...
Events coming up
-
Dec
9
GL.net Group Meeting - December 2009
Gloucester, United Kingdom
The beginning of this year holiday season will belong to mocks. Ronnie and Stephen will take us for a tour around exciting world of unit testing.
This thread is for discussions of What's new in System.Xml 2.0.