8.12. Implementing XPathNavigator

XPathNavigator is a cursor-based model, optimized to be useful with the XPath query language. Because XPathNavigator uses XPath's object model, the NodeType enumeration is a little different from the NodeType enumeration used with XmlReader.

Listing 8-13 shows the possible XPathNodeTypes. Note that XPathNodeType contains significantly fewer node types than XmlNodeType and does not contain the synthetic EndElement and EndEntity node types. Implementing an XPathNavigator over an arbitrary data source is similar to implementing an Xml-Reader with respect to the design considerations (fixed versus varying schema, elements versus attributes and namespace usage) described earlier.

Listing 8-13. XPathNodeType enumeration ...

Get Essential ADO.NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.