The XPath Data Model
An XPath query operates on a namespace well-formed XML document after it has been parsed into a tree structure. The particular tree model XPath uses divides each XML document into seven kinds of nodes:
Root Node
The document itself. The root node's children are the comments and processing instructions in the prolog and epilog and the root element of the document.
Element Node
An element. Its children are all of the child elements, text nodes, comments, and processing instructions that the element contains. An element also has namespaces and attributes. However, these are not child nodes.
Attribute Node
An attribute other than one that declares a namespace.
Text Node
The maximum uninterrupted run of text between tags, comments, and ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access