Loading login details...

DeltaXML Support Forums

 new topic  post reply 
moderators: chrisc nigelw tristanm
what is the equivalent value of the element "deltaxml:exchange"
Joined: 03-July-2008
Posts: 3
Location: Sacramento, United States of America
Posted: 24-July-2008 23:17
Hi,

In the new delta 5.0 core version, what is the equivalent value of the element "deltaxml:exchange" and also may i know under what scenarios "deltaxml:exchange" is populated.

thanks,
prakash
Exchange has been flattened/removed in v2
Joined: 27-March-2007
Posts: 54
Location: Malvern, United Kingdom
Posted: 28-July-2008 14:41
Hello Prakash,

Related docs are:

DeltaV1 format spec: http://www.deltaxml.com/dxml/library/core-format-specification.html
DeltaV2 for V1 users: http://www.deltaxml.com/dxml/library/deltav2-introduction.html

In the new delta 5.0 core version, what is the equivalent value of the element "deltaxml:exchange" and also may i know under what scenarios "deltaxml:exchange" is populated.


There is no direct equivalent to the exchange; it is not populated in v2.

In V1 exchange was used to group or wrap change.  It dates back to DeltaXML Core version 1.x releases which as well as supporting well-formed XML, also had delta formats for specific DTDs or grammars (in these cases the exchange had more semantics).

It could contain either 2 different (different localnames/namespaces) elements or an element and PCDATA. In V2 it is flattened/removed.

Consider some examples:

f1.xml:  <root><a/></root>
f2.xml:  <root><b/></root>
f3.xml:  <root>hello</root>

In delta V1, comparing f1.xml and f2.xml we would get:


<root xmlns:deltaxml="http://www.deltaxml.com/ns/well-formed-delta-v1" deltaxml:delta="WFmodify">
  <deltaxml:exchange>
    <deltaxml:old>
      <a deltaxml:delta="delete" />
    </deltaxml:old>
    <deltaxml:new>
      <b deltaxml:delta="add" />
    </deltaxml:new>
  </deltaxml:exchange>
</root>


In V2, we loose the wrappers, the deltaV2 attributes still describe what has been added/removed:

<root xmlns:deltaxml="http://www.deltaxml.com/ns/well-formed-delta-v1" deltaxml:deltaV2="A!=B" deltaxml:version="2.0" deltaxml:content-type="full-context">
  <a deltaxml:deltaV2="A" />
  <b deltaxml:deltaV2="B" />
</root>



Now comparing f1.xml and f3.xml, with v1:

<root xmlns:deltaxml="http://www.deltaxml.com/ns/well-formed-delta-v1" deltaxml:delta="WFmodify">
  <deltaxml:exchange>
    <deltaxml:old>
      <a deltaxml:delta="delete" />
    </deltaxml:old>
    <deltaxml:new>hello</deltaxml:new>
  </deltaxml:exchange>
</root>


and with v2:

<root xmlns:deltaxml="http://www.deltaxml.com/ns/well-formed-delta-v1" deltaxml:deltaV2="A!=B" deltaxml:version="2.0" deltaxml:content-type="full-context">
  <a deltaxml:deltaV2="A" />
  <deltaxml:textGroup deltaxml:deltaV2="B">
    <deltaxml:text deltaxml:deltaV2="B">hello</deltaxml:text>
  </deltaxml:textGroup>
</root>


In the case of the two element exchange we've removed some redundent information. In the element/PCDATA exchange, we've used the textGroup to show the added/deleted text.

The exchange did show or indicate how the matching algorithm worked, but at the expense of a lot more elements to process in the delta format for well-formed data.

If the removal of the 'grouping' worries anyone, please note the 'red-green premise' - is possible to move added/deleted data around provided they don't move past unchanged content.
See:  http://www.deltaxml.com/dxml/library/filters-and-pipelines.html section 5.2

Thanks,

Nigel[/img]
 new topic  post reply  To find out about new replies to this post as they occur
please subscribe to one of these feeds:
AtomRSS moderate