Loading login details...

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, dxu:vset="|A|B|"  means that the element appears in documents A and B.

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

  1. A new namespace is declared: xmlns:dxu="http://www.deltaxml.com/ns/unified-delta-v1"
  2. The root element has a dxu:vset attribute with a value showing all the versions of data in the file.
  3. In the dxu:vset attribute, the versions are separated using a pipe symbol. Note that the first and last characters will be the pipe symbol.
  4. The order of the versions in the dxu:vset attribute of the root element is the reverse order of addition to the unified delta file, i.e. most recent first.
  5. All other elements will have a dxu:vset attribute unless its value is the same as that of the parent node, in which case it is omitted.
  6. The value of each dxu:vset attribute will always be a subset of the actual or implied value of the dxu:vset attribute on its parent.
  7. Any versioned PCDATA is wrapped in a dxu:PCDATA element, which itself has a dxu:vset attribute.
  8. Unchanged attributes of any element remain as attributes.
  9. Changed attributes are held in a dxu:attributes element whose child elements are elements with the same names as the original attributes.
  10. The value of changed attributes are held as dxu:PCDATA items.
  11. The deltaxml:key attribute 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:

Examples

Examples of Elements in Unidelta

Document A

Document B

Document C

<example>
  <person>
    <firstName/>
    <lastName/>
    <T/>
  </person>
</example>

<example>
  <person>
    <firstName/>
    <lastName/>

  </person>
</example>

<example>
  <person>
    <firstName/>

  </person>
</example>

And the Unidelta for this will be as follows:

Unidelta

Comments

<example dxu:vset="|C|A|B|">
 <person>
  <firstName />
  <lastName dxu:vset="|A|B|" />
  <T dxu:vset="|A|" />
 </person>
</example>

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>
  <person>
    <firstName>J</firstName>
    <lastName>Smith</lastName>
  </person>
</example>

<example>
  <person>
    <firstName>John</firstName>
    <lastName>Smith</lastName>
  </person>
</example>

<example>
  <person>
    <firstName>J</firstName>
    <lastName>Smith</lastName>
  </person>
</example> 

And the Unidelta for this will be as follows:

Unidelta

Comments

<example dxu:vset="|C|A|B|">
 <person>
  <firstName>
    <dxu:PCDATA dxu:vset="|C|A|">J</dxu:PCDATA>
    <dxu:PCDATA dxu:vset="|B|">John</dxu:PCDATA>
   </firstName>
   <lastName>Smith</lastName>
 </person>
</example>

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>
  <person gender="M" age="36">
    <firstName>J</firstName>
  </person>
</example>

<example>
  <person gender="M" age="37">
    <firstName>J</firstName>
  </person>
</example>

<example>
  <person gender="M">
    <firstName>J</firstName>
  </person>
</example>

And the Unidelta for this will be as follows:

Unidelta

Comments

<example dxu:vset="|C|A|B|">
 <person gender="M">
  <dxu:attributes>
   <age dxu:vset="|A|B|">
    <dxu:PCDATA dxu:vset="|A|">36</dxu:PCDATA>
    <dxu:PCDATA dxu:vset="|B|">37</dxu:PCDATA>
   </age>
  </dxu:attributes>
  <firstName>J</firstName>
 </person>
</example>

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>.