Database Reference
In-Depth Information
eXist provides some extensions that allow you to view the DLN
identifiers assigned to nodes, and also to retrieve nodes by their
DLN identifiers. See the util:node and util:node-by-id func‐
tions in util . eXist also provides the add-exist-id serialization
option, which inserts the DLN identifiers into attributes on each
element of a document or node when you retrieve it from eXist; see
“Serialization” on page 118 .
DLN helps eXist perform efficient queries of XML documents, as often eXist can cal‐
culate the sets of nodes involved in an XPath expression by performing computations
using just their DLN identifiers.
Should you choose to retrieve nodes from eXist using DLN identi‐
fiers, you should be aware that DLN identifiers are not guaranteed
to be stable. After you update a document by replacing it or using
the XQuery update extension or XUpdate, it is likely that some of
the nodes in the document will have different identifiers.
Dynamic Level Numbering and Updates
So far we have looked at DLN within a fixed document, but it can also be useful to
understand how the DLN identifiers on nodes in a document may change if that
document is updated. There are three ways in which an XML document in eXist may
be updated:
Replacement
In this instance the node identifiers are not updated; rather, the original docu‐
ment is deleted and a new document is stored, and they just happen to have the
same URI within the database.
XUpdate
An XUpdate document may be processed against one or more documents; this
could lead to the insertion, deletion, or modification of nodes in the documents.
These modifications will lead to identifier changes.
The XQuery update extension
Similarly to XUpdate documents, XQuery update statements may be processed
against one or more documents, which could lead to the insertion, deletion, or
modification of nodes in the documents. These modifications will lead to identi‐
fier changes. The difference between this mechanism and XUpdate is that all
operations from a single XUpdate document will occur within the same database
transaction, while each XQuery update statement will be executed in its own
transaction.
Search WWH ::




Custom Search