In XPath, there are seven kinds of nodes: element, attribute, text, namespace, processing-instruction, comment, and document nodes.
XML documents are treated as trees of nodes. The topmost element of the tree is called the root element.
Look at the following XML document:
Example of nodes in the XML document above:
Atomic values are nodes with no children or parent.
Example of atomic values:
Items are atomic values or nodes.
Each element and attribute has one parent.
In the following example; the book element is the parent of the title, author, year, and price:
Element nodes may have zero, one or more children.
In the following example; the title, author, year, and price elements are all children of the book element:
Nodes that have the same parent.
In the following example; the title, author, year, and price elements are all siblings:
A node's parent, parent's parent, etc.
In the following example; the ancestors of the title element are the book element and the bookstore element:
A node's children, children's children, etc.
In the following example; descendants of the bookstore element are the book, title, author, year, and price elements:
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $7.95/mo SEO Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| XML Editor - Free Trial! |
| FREE Website BUILDER |
| Free Website Templates Free CSS Templates |
| Make Your Own Website |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|