The forward slash (/) combines location steps into a location path.
The node-set selected by the first step becomes the context node-set for the second step. The node-set identified by the second step becomes the context node-set for the third step, and so on.
child::PERIODIC_TABLE/child::ATOM
is an XPath expression that selects all ATOM
elements.
child::PERIODIC_TABLE/child::ATOM[1]
is an XPath expression that selects the first ATOM
element.
child::PERIODIC_TABLE/child::ATOM/child::SYMBOL
is an XPath expression that selects all SYMBOL
elements.
child::PERIODIC_TABLE/child::ATOM[ATOMIC_NUMBER="3"]
is an XPath expression that selects Lithium.
child::ATOM[SYMBOL="He"]/child::DENSITY/attribute::UNITS
is an XPath expression that selects the units in which the density of Helium is given.
child::PERIODIC_TABLE/child::ATOM/child::*
is an XPath expression that selects all the child elements of ATOM
elements.