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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.