O'Reilly logo

Special Edition Using XML, Second Edition by - et al. David Gulbransen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introducing XQuery

XQuery is intended to work with single XML documents or collections of XML documents. In addition, XQuery will be able to query XML document fragments or collections of fragments. It borrows syntax from XSLT 1.0 and XPath 1.0.

For example, to query the chapter elements in a document named book.xml, we could use an XQuery expression—a path expression—such as the following:

document("book.xml")//chapter 

As you can see, an XQuery expression is not written in XML. You might recognize the use of the document() function from XSLT 1.0 and a path expression, //chapter, from XPath 1.0. Less basic XQuery expressions add XQuery-specific syntax.

XQuery is not the first attempt at an XML query language. Other such query languages include ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required