XPath Element

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

XPath - Element

The most common usage of XPath is for selecting elements in an XML document. This lesson will provide a walkthrough of selecting many different elements, at different levels, in the XML Tree.

XPath Expression:


Notice: Each element added to this XPath expression is the child of the element before it.

  • drink is the child of inventory

  • pop is the child of drink

  • price is the child of pop

You can use this knowledge of parent-child relationships in an XPath expression to make sure your XPath is written properly.