The best XPath node Tutorial In 2024, In this tutorial you can learn XPath term,Node Relationship,
In XPath, there are seven types of nodes: element, attribute, text, namespace, processing instruction, comment, and document (root) nodes. XML document is treated as a node tree. Root of the tree is called the document node or root node.
Look at the following XML document:
The above XML document node examples:
The basic value is no father or no child nodes.
Examples of basic values:
Project is the basic values or nodes.
Each element and attribute has one parent.
In the following example, book element is the parent title, author, year, and price elements:
Element node can have zero, one or more children.
In the following example, title, author, year, and price elements are all children of the book element:
It has the same parent node
In the following example, title, author, year, and price elements are brothers:
The parent of a node, and the parent's parent, and so on.
In the following example, the ancestors of the title element are the book element and the bookstore element:
Child of a node, sub-sub, and so on.
In the following example, bookstore offspring is book, title, author, year, and price elements: