Skip Site Navigation «

DRX

app«drx

Web Developer Resource Index: XQuery

XQuery is a language for extracting data from XML sources. This is similar in concept to how SQL is designed to retrieve data from a RDBMS. However, XQuery uses XPath expressions to traverse the tree structure, or DOM, of an XML document, rather than the SQL model based on rows and columns of data stored in tables that are linked together with PKs and FKs.

The root of any XQuery expression is the doc() function which is used to open an XML document. If this application stored data in XML format (which it doesn’t—I’m using MySQL at the moment), a possible query to match one record on this page might look like:

doc('drx.xml')/resources/category/ \ XQuery[title='An Introduction to XQuery']

And would theoretically return An Introduction to XQuery.

If you have some experience with SQL you should be able to see that this is a very simple example that selects a single record. XQuery uses more powerful expressions known as FLWOR, which are equivalent to the SQL SELECT FROM HAVING WHERE model.

It is beyond the scope of this brief introduction to delve into any additional discussion of XQuery. Consult the resources below for more information.

Updated: Wednesday, October 29th, 2008 @ 1:53 AM EDT

Navigation

Resources

Matching Tags

Indexes

§ A.Author
§ B.Best
§ D.Domain
§ F.Recent
§ G.Tag
§ H.Title

Search for XQuery on:


Last updated: Wednesday, October 29th, 2008 @ 1:53 AM EDT [2008-10-29T05:53:46Z]   home

(c) 2008-2010, Douglas W. Clifton, loadaveragezero.com, all rights reserved.