3.5. Query Language Extensions

Let's take a quick look at some useful extensions eXist adds to standard XPath to enable you to efficiently use the database.

3.5.1. Specifying the Input Document Set

Since a database may contain an unlimited set of documents, two additional functions are required by eXist's query engine to determine the set of documents against which an expression will be evaluated: document() and collection(). document() accepts a single document name, a list of document names, or a wildcard as parameters. The wildcard (*) selects all documents in the database. The collection() function specifies the collection whose documents are to be included into query evaluation. For example:

 collection('/db/shakespeare')//SCENE[ SPEECH[ ...

Get XML Data Management: Native XML and XML-Enabled Database Systems now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.