![]() |
XPath-Relative Path is the relative path to the destination node. The relative path starts with the node that we select. For the relative path, we don’t have to start with the root node of the XML tree. This approach simplifies navigation within XML documents, making it easier to target specific nodes without specifying the entire path from the root node. Syntax: <xsl:TagName select = "node1/node2/...">
Parameters:
Example 1: In this example, we will use the relative path to select the different nodes of students. Save the file as mentioned and view xsl file in we browser. XML
XML
Output: ![]() relative Example 2: In this example we will select different node of XML tree and use apply template on nodes. Save the file as mentioned and run the xsl file in web browser. XML
XML
Output: ![]() relative2 In the provided examples, we demonstrated how XPath relative paths can be employed to access and manipulate data within XML documents. Whether you are extracting information or applying templates, mastering relative paths is essential for effective XML processing. |
Reffered: https://www.geeksforgeeks.org
Data Formats |
Related |
---|
![]() |
![]() |
|
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 13 |