In XPath, there are seven types of nodes: elements, attributes, text, namespaces, processing commands, comments, and document nodes (or become root nodes ). In XPath, Node has seven types of nodes: elements, attributes, and text.
In XPath, there are seven types of nodes: elements, attributes, text, namespaces, processing commands, comments, and document nodes (or become root nodes ).
XPath term Node)
There are seven types of nodes in XPath: elements, attributes, text, namespaces, processing commands, comments, and document (root) nodes. XML documents are viewed as node trees. The root of a tree is called a document node or a root node.
See the following XML document:
Harry Potter J K. Rowling
2005
29.99
Node example in the XML document above:
(Document Node) j k. Rowling(Element node) lang = 'en' (attribute node)
Base value (or Atomic value, Atomic value)
The base value is a node with no parent or child.
Example of basic value:
J K. Rowling'en'
Item)
A project is a base value or node.
Parent node)
Each element and attribute has a parent.
In the following example, the book element is the parent of the title, author, year, and price elements:
Harry Potter J K. Rowling
2005
29.99
Child)
There can be zero, one, or more sub-nodes.
In the following example, the title, author, year, and price elements are child of the book element:
Harry Potter J K. Rowling
2005
29.99
Sibling)
Having the same parent node
In the following example, the title, author, year, and price elements are all siblings:
Harry Potter J K. Rowling
2005
29.99
Advanced (Ancestor)
The parent and parent of a node.
In the following example, the first generation of the title element is the book element and the bookstore element:
Harry Potter J K. Rowling
2005
29.99
Descendant (Descendant)
The child of a node, the child of the child, and so on.
In the following example, the future generations of bookstore are book, title, author, year, and price:
Harry Potter J K. Rowling
2005
29.99