DOM runtime database

From COLLADA Public Wiki
Jump to: navigation, search

The DOM runtime database is a resident, active cache of COLLADA elements. This cache is based on C++ COLLADA elements handed to the cache by the I/O plug-in. It is sometimes referred to as the COLLADA runtime database or simply as the DOM database.

Using the database

The database is represented by the daeDatabase class, which is useful for manipulating documents and for retrieving elements after they have been loaded into the database or before saving them from the database. For more information, see:

Database internals

The DOM database is straightforward except that it needs to be thought of as a runtime database, since a persistent database store (XML database, SQL database) would be implemented as an I/O plug-in.


The queryElement function has never been implemented but would most likely be used to parse XPath or XQuery expressions. The current DOM cannot do full XQuery support because there is no way to address attributes or values by themselves and XQuery allows you to get lists of all attributes that … , etc.

Database implementation

The stlDatabase is the default implementation of a daeDatabase. Someone might want to write their own database if they want database paging, that is, moving data in and out of memory based on usage. (This would require a lot of work besides just writing the database, though.)

Database structure

The database contains two structures to store all elements:

  • A sorted list of all elements, sorted by element type.
  • A multimap with the key being an element ID and the value being the elements themselves.
    The multimap is used to speed up URI resolution because URIs query the database by element ID. It is also used if the user supplies an ID for the getElement or getElementCount query functions.

COLLADA DOM - Version 2.4 Historical Reference
List of main articles under the DOM portal.
User Guide chapters:  • Intro  • Architecture  • Setting up  • Working with documents  • Creating docs  • Importing docs  • Representing elements  • Working with elements  • Resolving URIs  • Resolving SIDs  • Using custom COLLADA data  • Integration templates  • Error handling

Systems:  • URI resolver  • Meta  • Load/save flow  • Runtime database  • Memory • StringRef  • Code generator
Additional information:  • What's new  • Backward compatibility  • Future work
Terminology categories:  • COLLADA  • DOM  • XML