Chapter 7. Extension Modules

eXist has a large number of extension modules built in that allow you to do lots of wonderful things you can’t do with straight XQuery, such as manipulate the database contents, inspect an HTTP request, encrypt/decrypt data, and perform XSLT transformations. This chapter will provide you with an overview of the module mechanism in general. An overview of the available modules can be found in Appendix A.

Types of Extension Modules

Extension modules come in two flavors, which you need to be aware of because they behave differently in eXist. The module descriptions in Extension Module Descriptions will tell you the module type. We will also explain how to find out the module type yourself in Enabling Extension Modules.

Extension Modules Written in Java

Extension modules written in Java are fully integrated in eXist. You don’t even have to put an import module statement in your XQuery code to use them. Most of the eXist core functionality you use regularly is Java based (e.g., xmldb, request, transform, response, and util).

For instance, when you want to find out the eXist home directory by calling system:get-exist-home, you can simply do this in your code without an import module statement for the system module. However, some people like to have this explicitly spelled out, so they could add:

import module namespace system="http://exist-db.org/xquery/system";

Not all Java modules present are enabled by default. Even worse, some of them are not even built in (compiled ...

Get eXist 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.