Managing change in an XML environment

ODT Track Changes: how do we represent a delete across element boundaries?

PosterContent
nk4um Administrator
Posts: 35
June 21, 2010 11:25
I am pleased that I am the first to spot the deliberate mistake in my post above - this is not a split but a merge! It was late in the afternoon...

The respresentation is correct if delta:merge can only merge elements of the same type. This raises the issue about whether we should be able to merge elements of two different types. However, the syntax for delta:merge is in fact perfectly capable of allowing merge of two different element types, assuming that the final version of the enclosing element is the same as the first element, i.e. merging an <h> followed by a <p> always results in an <h>.

Therefore we could represent the merge described above in the following way:

<h>
This is a
<delta:merge delta:removal-type=''merge'' delta:removal-change-idref=''2''>
  <delta:leading-partial-content>heading</delta:leading-partial-content>
  <delta:intermediate-content/>
  <delta:trailing-partial-content>
    <p>This is a sample</p>
  </delta:trailing-partial-content>
</delta:merge>
paragraph.
<h>


This is a much neater representation than the one in the previous post. I think we can extend the definition of merge to allow this, without any ambiguity.

Unfortunately this would lose the symmetry between delta:split and delta:merge as delta:split is only allowed to split an element into two elements of the same type. I think this can be solved also as follows: The current rule for split is, "The first part of the split element is the preceding sibling element of the same type ignoring any elements that have been added in the same or a later CT". If we remove "of the same type" then we restore the symmetry with merge and allow different types of element to be merged and split.

To summarise, this example suggests updates to the spec as follows:
- merge can merge elements of different types
- split can split an element into two elements which have differen types

Please do comment on this suggestion.
nk4um Administrator
Posts: 35
Ganesh Paramasivam:

1. Most of the scenarios I thought were not handled by the current
version of the spec fell under the broad category of "Delete Changes
across element boundaries".

If we have something like this
<h> This is a heading </h>
<p> This is a sample paragraph </p>

And we select and delete last half of the header and the first half of
paragraph ( shown here with an underline )
<h> This is a heading </h>
                 --------------
<p> This is a sample paragraph </p>
       ----------

Result:
<h> This is a paragraph </h>

How do we save this delete change ?


Robin La Fontaine:
You can only split an element of the same type, so this could not be used here. So this would be represented as:

<h delta:removal-type=''remove-leaving-content'' delta:removal-change-idref=''1'' 
delta:end-element-idref=''888''/>
<h delta:insertion-type=''insert-around-content'' delta:insertion-change-idref=''1''>
This is a <delta:deleted-mixed-content delta:removal-change-idref=''1''>heading </delta:deleted-mixed-content>
<end-element delta:end-element-id=''888''/>
<p delta:removal-type=''remove-leaving-content'' delta:removal-change-idref=''1''
delta:end-element-idref=''889''/>
<delta:deleted-mixed-content delta:removal-change-idref=''1''>This is a</delta:deleted-mixed-content>
paragraph.
<end-element delta:end-element-id=''889''/>
</h>


It does not look very pretty, but it works! If the split element could split into elements of different types, then it could be used here, but it would make the split element more complex. I do not think this example is a very common edit, but if it is then perhaps we need to consider a more elegant representation.