Web Developer Resources
The Site for Your Web Development Resource Needs

Web Developer Resources

What is XQuery?

August 22nd, 2008 . by Henry


Image source: www.xquery.com

XQuery was made so that there was a way to query data stored in an XML document, much the same way SQL is used to query a database.

XQuery uses simple functions to query a document. An XQuery function looks a little like a javascript function in that it uses parentheses containing an element that is to be the object of the function. With XQuery, the element in parentheses is typically the name of the document or file to be queried.

To find what it is looking for within that file, XQuery narrows its search by using path expressions that look a lot like the path for an ordinary file stored on your computer, with the various subsets of data within the XML file separated by backslashes. The predicate is the final component of an XQuery function. The predicate tells the function exactly what information, data, or range of data within a particular subset is to be extracted and returned to the user.

Comments are closed.