1.

What is path expression in XPath?

Answer»

XPath uses a path expression to select node or list of nodes from an xml document. Following is the list of useful paths and expression to select any node/ list of nodes from an xml document.

ExpressionDescription
node-nameSelect all nodes with the given name "nodename"
/Selection starts from the root node
//Selection starts from the current node that match the selection
.Selects the current node
..Selects the parent of the current node
Selects attributes
studentExample − Selects all nodes with the name "student"
class/studentExample:Selects all student elements that are children of class
//studentSelects all student elements no matter where they are in the document


Discussion

No Comment Found