|
>Home>Learn XQuery>White Papers>XQuery Myths>XPath vs XQuery
Print
Misunderstanding: Aren't XPath and XQuery the same thing?
Actually, XQuery builds on XPath and XSLT. Software architects and developers use XPath as a query language to find elements in an XML document and transform them into XHTML or another XML format using XSLT. For example, a developer uses XPath to find the dental records of a patient in an XML file and uses XSLT to package the patient information in an HTML view that is displayed in a browser. This works fine where the data is already in XML form, but XPath and XSLT only work on XML files.
XPath is selection-oriented while XSLT is transformation-oriented; both technologies still need an efficient way to select, join, and transform the data into the desired form. XQuery addresses the data needs of an application by enabling access to multiple sources, selecting information from them, and joining the data. This is true even for non-XML data -- sources include forms, Web pages, and other loosely structured data.
|