Unified Delta Format
DeltaXML Unified Delta Format Description
The DeltaXML Unified Delta or Unidelta format is a representation of two or more XML documents in a single document. Any of the original documents can be extracted from the Unidelta.
Namespace and Prefix
The namespace for Unidelta is
http://www.deltaxml.com/ns/unified-delta-v1 and the preferred
prefix is dxu: .
Elements and Attributes
This is a list of the elements used by Unidelta:
|
Element name |
Content |
Purpose |
|---|---|---|
|
dxu:attributes |
Elements each of which has a name corresponding to an attribute beloning to the parent element. |
Appears as the first child of an element and details any differences between the attributes for this element |
|
dxu:PCDATA |
PCDATA or, when within a dxu:attributes element, CDATA represenitng the value of an attribute. |
To record a text item or attribute value that appeared in one or more of the input documents. |
This is a list of the attributes used by Unidelta
|
Attribute name |
Content |
Purpose |
|---|---|---|
|
dxu:vset |
Details the version set for this element, using letters such as 'A', 'B' and 'C' as the version identifiers and a pipe symbol '|' as the delimiter. |
This attribute lists the documents in which a particular data item appears.
For example, |
Description
There is no DTD or Schema for a Unidelta, but the Unidelta will have the same look and feel as the original documents. There is a set of simple rules which apply to the Unidelta format. In general terms, the Unidelta generated from a set of documents will be a union of these documents in the sense that all the data that appears in any of the documents will also appear in the Unidelta.
Elements, attributes and text that are identified by DeltaXML as common to two or more of the documents are shared in the Unidelta. A subtree that appears unchanged in one or more documents will appear in the Unidelta almost exactly as it appeared in the original document(s).
Rules
Summary of Unified Delta ('Unidelta') format
- A new namespace is declared:
xmlns:dxu="http://www.deltaxml.com/ns/unified-delta-v1" - The root element has a
dxu:vsetattribute with a value showing all the versions of data in the file. - In the
dxu:vsetattribute, the versions are separated using a pipe symbol. Note that the first and last characters will be the pipe symbol. - The order of the versions in the
dxu:vsetattribute of the root element is the reverse order of addition to the unified delta file, i.e. most recent first. - All other elements will have a
dxu:vsetattribute unless its value is the same as that of the parent node, in which case it is omitted. - The value of each
dxu:vsetattribute will always be a subset of the actual or implied value of the dxu:vset attribute on its parent. - Any versioned PCDATA is wrapped in a
dxu:PCDATAelement, which itself has adxu:vsetattribute. - Unchanged attributes of any element remain as attributes.
- Changed attributes are held in a
dxu:attributeselement whose child elements are elements with the same names as the original attributes. - The value of changed attributes are held as
dxu:PCDATAitems. - The
deltaxml:keyattribute remains as an attribute and is never subject to a change.
Expanded Unidelta
There is also an expanded or canoncial form of the Unidelta. This can be useful in some situations. This is the same as the standard Unidelta except that:
- all elements have a
dxu:vsetattribute - all text is wrapped in
dxu:PCDATA - all attributes are expanded into the
dxu:attributeselement
Examples
Examples of Elements in Unidelta
|
Document A |
Document B |
Document C |
|---|---|---|
|
<example> |
<example> </person> |
<example> </person> |
And the Unidelta for this will be as follows:
|
Unidelta |
Comments |
|---|---|
|
<example dxu:vset="|C|A|B|"> |
The <person> element and the <firstName> element have the same value for the dxu:vset as their parent elements. Element <lastName> appears in two documents, A and B. Element <T> appears in only one document, A. |
Examples of Text in Unidelta
|
Document A |
Document B |
Document C |
|---|---|---|
|
<example> |
<example> |
<example> |
And the Unidelta for this will be as follows:
|
Unidelta |
Comments |
|---|---|
|
<example dxu:vset="|C|A|B|"> |
The text in <firstName> is "J" in both A and C. The text in <firstName> is "John" in document B. The text in <lastName> is the same in all documents. |
Examples of Attributes in Unidelta
|
Document A |
Document B |
Document C |
|---|---|---|
|
<example> |
<example> |
<example> |
And the Unidelta for this will be as follows:
|
Unidelta |
Comments |
|---|---|
|
<example dxu:vset="|C|A|B|"> |
The attribute 'gender' is unchanged and so appears as a regular attribute. The attribute 'age' has a value of 36 in document A and 37 in B. Element <firstName> appears now as the second child of <person>. |