Chapter 5. Working with the Database

At its core, eXist is an XML database. It stores XML efficiently and makes fast querying possible. Besides XML, it is also capable of storing other file types. Although in default configuration it doesn’t do much with them besides storing and retrieving, this capability is useful when you are building applications with eXist.

This chapter is about eXist’s database: what’s in it, how structured, how you access and update its content, and (of course) how you query it.

The Database’s Content

This section will dive into the contents of the database.

Help: Where Is My XML?

Superficially, when you’re accessing the database using a WebDAV client, eXist’s database looks like a filesystem: you’ll see directories and files and you can work with them as any other filesystem.

Of course, this is only the surface; underneath the waves, things look different. XML files are “ripped apart” (or “shredded”), indexed, and stored in a way that makes searching, indexing, and retrieval efficient. You can see this in action when you store a file in the database and reopen it: the indentation after reopening will probably look different. This is because the document was not stored as is, but rather as a tree structure according to the XML data model. The document was likely recreated using different indentation rules than those with which the original was created.

Related to this is one of the most frequently asked questions from eXist newcomers: “where is my XML?” People look ...

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.