The following example code shows that the descendants of the publisher element are the product, title, author, and year elements.
The structure of the descendant flows the opposite way, that is, from bottom to top:
<publisher> <product> <title>Quick Start Guide: R</title> <author>Olgun Aydin</author> <year>2018</year> </product></publisher>
XPath is used to select nodes in the XML document to indicate the path expressions of these expressions. The node is selected by following a path or steps. The most useful ways and explanations are given in this table:
Expression | Description |
---|---|
node1 |
This expression is used for selecting all of the nodes that have the name node1. |
/ |
This expression is used for selecting nodes from ... |