Share via


Node Types Recognized with XPath Queries 

The types of nodes recognized in an XPath query are not the same node types found in the Document Object Model (DOM).

W3C XPath Node Types

The types of nodes recognized in an XPath query are not the types of nodes found in the Document Object Model (DOM). The following are the XPath node types represented by the XPathNodeType enumeration.

These node types are based on the XPath data model, where the nodes are derived from the XML Information Set. The SignificantWhitespace and Whitespace node types are Microsoft .NET Framework extensions to the base node types described in the XPath data model.

The attribute node type is used differently in the XPath data model than it is in the DOM. In the XPath data model, the element node has a set of attribute nodes related to it and the element node is the parent of each attribute node. However, in the DOM, the element node is the owner and not the parent. In both models, attribute and namespace nodes are not considered child nodes of the element node.

The namespace node type is an addition to the XPath data model and is not a recognized DOM node type.

For more information about navigating element, attribute, and namespace nodes, see the Node Set Navigation Using XPathNavigator and Attribute and Namespace Node Navigation Using XPathNavigator topics.

See Also

Reference

XmlDocument
XPathDocument
XPathNavigator

Concepts

Process XML Data Using the XPath Data Model
Select XML Data using XPathNavigator
Evaluate XPath Expressions using XPathNavigator
Matching Nodes using XPathNavigator
XPath Queries and Namespaces
Compiled XPath Expressions