Menu item in → → XMLmind XML Editor - Online Help (and also this option in XMLmind XML Editor - Online Help) allows to store the entire revision history of a document in the XML file containing this document.
The revision history is stored in a single <?xxe-revisions>
processing-instruction found at the end of the document. Short example:
ambiguë d’un cœur qui au zéphyr préfère les jattes de
kiwi</foreignphrase>".</para>
</section>
<?xxe-revisions
#3 2015-09-04T14:35:48Z charles
#2 2015-09-04T14:29:20Z bart
1sPEAAABiXgAEocmAAAHBXOHExMIQwsAhRaEVw==
#1 2015-09-04T14:26:28Z john
1sPEAAABhyYAgQmHJQA/LBhmIjxmb3JlaWduOj0iZnJlPz5Qb3J0ZXogY2UgdmlldXggd2hpc2t5
IGF1IGp1Z2UgYmxvbmQgZnVtZTwvPiJzhAwTB0OBKlMx3zMGEwqTBxMEAQljBvczBAEEUyQBJzME
AQcjDgECkwpjCwCEPBREMoEthAI8g3QhFg+CIoETcJSCBw==
?>
The format of the <?xxe-revisions>
processing-instruction is described as follows:
This processing-instruction contains one or more revisions separated by newlines.
A revision consists in a header followed by a binary delta encoded in base 64.
A header, for example:
#1 2015-09-04T14:26:28Z john
contains the revision number (1
), the date this revision was saved to disk (2015-09-04T14:26:28Z
) and the author of this revision (john
).
First header is about the most recent revision. Hence it is not followed by a binary delta.
For example, let's suppose the above snippet comes from document doc.xml
. Most recent revision is #3 and corresponds to the contents of doc.xml
. It has been created by charles
on 2015-09-04T14:35:48Z
.
The binary delta of revision #N
is the result of applying the VCDIFF encoding algorithm between a normalized XML form of the content of revision #N+1
and a normalized XML form of the content of revision #N
.
For example, the normalized XML form of doc.xml
is simply the UTF-8 bytes of doc.xml
saved unindented (of course, without the <?xxe-revisions>
processing-instruction). The result of applying the VCDIFF decoding algorithm to the UTF-8 bytes of doc.xml
, that is, revision #3, and the binary delta "1sPEAAABiXgAEocmAAAHBXOHExMIQwsAhRaEVw==
" results in the UTF-8 bytes of revision #2 of doc.xml
.