Sunday, February 1, 2015

what is xpath

XPath is a language for addressing specific parts of an XML document. XPath, like the Document Object Model (DOM), models an XML document as a tree of nodes. An XPath expression is a mechanism for navigating through and selecting nodes from the XML document.

XPath is a language for addressing specific parts of an XML document. XPath, like the Document Object Model (DOM), models an XML document as a tree of nodes. An XPath expression is a mechanism for navigating through and selecting nodes from the XML document. An XPath expression is, in a way, analogous to an SQL query used to select records from a database.

There are different types of nodes, including element nodes, attribute nodes and text nodes. XPath defines a way to compute a string-value for each type of node.

XPath defines a library of standard functions for working with strings, numbers and boolean expressions.

    child::* - Selects all children of the root node.
    .//name - Selects all elements having the name "name", descendants of the current node.
    /catalog/cd[price>10.80] - Selects all the cd elements that have a price element with a value larger than 10.80

0 comments:

Post a Comment

 
© 2014 technical online tips