• Post author:
  • Post category:General


XPath is used to query selected nodes from an XML document.and used to navigate through elements and attributes in an XML document.XPath stands for XML Path Language. XPath uses “path like” syntax to identify and navigate nodes in an XML document. XPath contains over 200 built-in functions. XPath is a major element in the XSLT standard. XPathspecification specifies seven types of nodes which can be the output of execution of the XPath expression.

  • Root
  • Element
  • Text
  • Attribute
  • Comment
  • Processing Instruction
  • Namespace

XPath uses a path expression to select node or a list of nodes from an XML document.

S.No. Expression & Description
1 node-name

Select all nodes with the given name “node name”

2 /

Selection starts from the root node

3 //

Selection starts from the current node that match the selection

4 .

Selects the current node

5 ..

Selects the parent of the current node

6 @

Selects attributes


This XML file does not appear to have any style information associated with it. The document tree is shown below.





<ns1:siteCode network=”WIS” agencyCode=”ABCD”>0124454</ns1:siteCode>


<ns1:variable ns1:oid=”45807073″>

<ns1:variableCode network=”WIS” vocabulary=”WIS:UnitValues” default=”true” variableID=”45807073″>00020</ns1:variableCode>

<ns1:variableName>Temperature, air, &#176;C</ns1:variableName>

<ns1:variableDescription>Temperature, air, degrees Celsius</ns1:variableDescription>

<ns1:valueType>Derived Value</ns1:valueType>

<ns1:unitCode>deg C</ns1:unitCode>



<ns1:value qualifiers=”P” dateTime=”2019-05-01T00:00:00.000-04:00″>3.1</ns1:value>

<ns1:qualifierqualifierID=”0″ ns1:network=”WIS” ns1:vocabulary=”uv_rmk_cd”>


<ns1:qualifierDescription>Provisional data subject to revision.</ns1:qualifierDescription>








In Talend, nodes can be extracted using tExtractXMLField component.