Process XML Data Using the XPath Data Model

The System.Xml namespace provides a programmatic representation of XML documents, fragments, nodes, or node-sets in-memory, using the XmlDocument or XPathDocument classes.

The XPathDocument class provides a fast, read-only, in-memory representation of an XML document using the XPath data model. The XmlDocument class provides an editable in-memory representation of an XML document implementing W3C Document Object Model (DOM) Level 1 Core and Core DOM Level 2. Both classes implement the IXPathNavigable interface and return an XPathNavigator object used to select, evaluate, navigate, and in some cases, edit the underlying XML data.

The following sections describe the functionality of the XPathNavigator class based on the class that returns it.

Reading XML Data using XPathDocument and XmlDocument

Describes how to create a read-only XPathDocument class object to read an XML document and how to create an editable XmlDocument class object to read and edit an XML document. This topic also describes how return an XPathNavigator object from each class to navigate and edit an XML document.

Selecting, Evaluating and Matching XML Data using XPathNavigator

Describes the methods of the XPathNavigator class used to select nodes in an XPathDocument or XmlDocument object using an XPath query, evaluate and examine the results of an XPath expression, and determine if a node in an XML document matches a given XPath expression.

Accessing XML Data using XPathNavigator

Describes the methods of the XPathNavigator class used to navigate nodes, extract XML data and access strongly typed XML data in an XPathDocument or XmlDocument object.

Editing XML Data using XPathNavigator

Describes the methods of the XPathNavigator class used to insert, modify and remove nodes and values from an XML document contained in an XmlDocument object.

Schema Validation using XPathNavigator

Describes the ways to validate the XML content contained in an XPathDocument or XmlDocument object.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft