6.2. Data Model

The XPath data model is relatively simple. Any XML document or object is a set of nodes of one of seven types (listed below). These nodes are organized into a hierarchical tree. In addition to this tree structure, a linear ordering of the nodes is maintained; this ordering is called “document order.”

The document order of nodes matches the order in which the first character of that node appears in the document character string form. Thus an element node precedes all of its children, because the element start tag's opening left angle bracket occurs before all element content, attributes, or namespace declarations. By convention, the root node, which has no character representation, comes first in document order:

  • Root node

  • Element ...

Get Secure XML: The New Syntax for Signatures and Encryption 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.