XPath: Types of Nodes

XPath specifies nodes for the following constructs in an XML document:

  • Element
  • Attribute
  • Namespace
  • Comment
  • Processing instruction

In addition, XPath specifies a root node. The root node is a conceptual representation of the entire XML document. It is the parent node to the root element of the XML document, which is called the document element node. The root node also acts as the parent node to the processing instructions and comments that can occur in the prolog. In addition, the root node acts as the parent node to the declarations such as comments that can occur after the root element of an XML document.

The graphic shows the nodes specified by XPath to represent XML constructs.
Click the Next button to continue.