Database Reference
In-Depth Information
When a document is modified, we want to preserve the integrity of the conceptual
model of hierarchical identifiers that have previously been assigned to nodes in the
document. However, we need only concern ourselves with insertions between exist‐
ing nodes, because:
• Insertions as the last following sibling or insertions as a new only child can be
assigned new DLN identifiers without our needing to change any existing identi‐
fiers to maintain integrity.
• Modifications to existing nodes (e.g., renaming) do not change their identifiers.
• Deletions do not break the integrity of our model. It does not matter if sibling
1.2 is followed by sibling 1.4 because 1.3 was deleted, as long as higher numbers
indicate the order.
If we could not maintain our existing identifiers on insertion, we would have to re-
number all of the nodes in the document, which would be a very computationally
expensive exercise. In fact, this is exactly what eXist used to do before it implemented
DLN. Luckily, DLN provides a mechanism whereby we don't need to renumber exist‐
ing nodes but can still perform insertions: subvalue identifiers .
If we consider the case where we have two elements called “Name” and “Quantity”
with the identifiers 1.2.1 and 1.2.2 , respectively, we could insert a new sibling ele‐
ment named “Cost” between them by using subvalues. As shown in Figure 4-11 , the
new element “Cost” would have the identifier 1.2.1/1 . The /1 indicates the subvalue;
that is, “Cost” follows “Name” ( 1.2.1 ) but precedes “Quantity” ( 1.2.2 ).
Figure 4-11. A simple XML document and the corresponding DLN model after update
 
Search WWH ::




Custom Search