XQuery tutorial

The best way to explain XQuery is to say that the relationship between XQuery and XML is equivalent to the relationship between SQL and database tables.

XQuery is designed to query XML data - not limited to XML files, but also including any data that can be presented in XML form, including databases.

You should have the following basic knowledge:

Before you continue learning, you need to have a basic understanding of the following knowledge:

  • HTML / XHTML
  • XML / XML namespaces
  • XPath

If you want to learn these projects first, please visit our Home page Access these tutorials.

What is XQuery?

  • XQuery is a language used for XML data queries
  • The role of XQuery in XML is similar to the role of SQL in databases
  • XQuery is built on top of XPath expressions
  • XQuery is supported by all major database engines (IBM, Oracle, Microsoft, etc.)
  • XQuery is a W3C standard

XQuery is related to XML queries

XQuery is a language used to search for and extract elements and attributes from XML documents.

This is an example of an XQuery solution to a practical problem:

“Select all CD records with prices below $10 from the CD collection stored in the cd_catalog.xml XML document.”

XQuery and XPath

XQuery 1.0 and XPath 2.0 share the same data model and support the same functions and operators. If you have already learned XPath, learning XQuery will not be a problem.

You can find more information in ourXPath HandleidingRead more about XPath in the

Application examples of XQuery

XQuery can be used for:

  • Extract information for use in network services
  • Generate summary reports
  • Convert XML data to XHTML
  • Search network documents to obtain relevant information

XQuery is a W3C recommended standard

XQuery is compatible with various W3C standards, such as XML, Namespaces, XSLT, XPath, and XML Schema.

XQuery 1.0 werd op 23 januari 2007 geïntroduceerd als een aanbevolen standaard van de W3C.

Voor meer informatie over de W3C XQuery-activiteiten, lees onzeW3C Handleiding》。