Import Xml using XPATH

Before going to know, first we should know about xpath. Xpath is a query language used to pick out pieces of information from web pages.

XPath is a syntax for defining parts of an XML document
XPath uses path expressions to navigate in XML documents
XPath contains a library of standard functions
XPath is a major element in XSLT
XPath is a W3C recommendation

XPath Path Expressions

XPath uses path expressions to select nodes or node-sets in an XML document. These path expressions look very much like the expressions you see when you work with a traditional computer file system.
XPath Standard Functions

XPath includes over 100 built-in functions. There are functions for string values, numeric values, date and time comparison, node and QName manipulation, sequence manipulation, Boolean values, and more.
XPath is Used in XSLT

XPath is a major element in the XSLT standard. Without XPath knowledge you will not be able to create XSLT documents.

XQuery and XPointer are both built on XPath expressions. XQuery 1.0 and XPath 2.0 share the same data model and support the same functions and operators.

XPATH is a W3C Recommendation

XPath became a W3C Recommendation 16. November 1999.

XPath was designed to be used by XSLT, XPointer and other XML parsing software.

  • // – this means select all elements of the type<
  • //h3 – this means select all h3 elements
  • [@class=”] – this means only select those elements that meet the criteria given – Example: look for H1
  • //h3[@class=’storytitle’] – this means only select elements that look like:h3 class=”storytitle”Title/h3

Leave a Reply

Your email address will not be published. Required fields are marked *