XPath Relative Path

A path is called relative path if it is started with the node that we've selected.

See this syntax which specifies locating the elements using relative path to employee node.


XPath Relative Path Example

Let's take an example locating the elements using absolute path. Create an XML document employee.xml and its stylesheet document employee.xsl which uses the XPath expressions.

Employee.xml

Employee.xsl

Output:

Xpath Relative path 1
Next TopicXPath Axes




Latest Courses