By Godha G N of Sonata Software Ltd.
This article will articulate more on the features of Track Changes/Revisions in a Word document.
Within a WordprocessingML document, the following types of revisions may be used to track the changes to a document:
- Insertions
- Deletions
- Format Change
- Moves
- Changes to run/paragraph/table/numbering/section properties
- Changes to custom XML markup
When “Track Changes” is put ON for a document, the <w:trackRevisions/> node is included in the “settings.xml” file. This will enable only the Insertions and Deletions for revisions, in order to enable the Format Changes; there is a possibility to separately enable this. Doing this will remove the <w:doNotTrackFormatting/> node from the “settings.xml” file which in turn indicates that formatting is enabled for change tracking.
The nodes which are added into the “document.xml” file in order to identify the type of revision which has taken place after the “Track Changes” is enabled for a WordprocessingML document are as follows –
Insertions – <w:ins>
Deletions – <w:del>
Format Change – <w:rPrChange>
Moves – <w:moveToRangeStart>, <w:moveTo>, <w:moveToRangeEnd>
Table Row Inserts – <w:trPr> will have <w:ins>
Table Row Deletes – <w:trPr> will have <w:del>
Table Column Inserts – <w:tc> will have <w:ins>
Custom XML markup Inserts – <w:customXmlInsRangeStart>, <w:customXmlInsRangeEnd>
Custom XML markup Deletes – <w:customXmlDelRangeStart>, <w:customXmlDelRangeEnd>
Custom XML markup Moves – <w:customXmlMoveFromRangeStart>, <w:customXmlMoveFromRangeEnd>, <w:customXmlMoveToRangeStart>, <w:customXmlMoveToRangeEnd>
Inserted Numbering Properties – <w:numPr> will have <w:ins>
Consider the following example –
<w:ins w:id="1" w:author="joe smith" w:date="2007-01-10T17:03:00Z">
A revision consists of two required pieces of information:
- The revision type (specified via the name of the revision element). Eg. w:ins, w:del, etc.
- A unique revision identifier (used to uniquely identify revisions). Eg. w:id="1"
This specifies a unique identifier for an annotation within a WordprocessingML document. The restrictions on the id attribute, if any, are defined by the parent XML element. If this attribute is omitted, then the document is non-conformant. It specifies a unique identifier for an annotation within a WordprocessingML document. The restrictions on the id attribute, if any, are defined by the parent XML element. If this attribute is omitted, then the document is non-conformant.
As well as optional information of:
- The author of the revision. Eg. w:author
This specifies the author for an annotation within a WordprocessingML document. If this attribute is omitted, then no author shall be associated with the parent annotation type.
- The date and time of the revision. Eg. w:date
This specifies the date information for an annotation within a WordprocessingML document. The use of this information is outside of the scope of the Standard. If this attribute is omitted, then no date information shall be associated with the parent annotation type.
Explanation of the track change elements in detail –
ins - This element specifies that the inline-level content contained within it shall be treated as inserted content which has been tracked as a revision.
del - This element specifies that the inline-level content contained within it shall be treated as deleted content which has been tracked as a revision.
moveFrom - This element specifies that the inline-level content contained within it shall be treated as content which has been moved away from this location and tracked as a revision.
moveFromRangeEnd - This element specifies the end of a region whose move source contents are part of a single named move.
moveFromRangeStart - This element specifies the start of a region whose move source contents are part of a single named move.
moveTo - This element specifies that the parent paragraph has been moved to this location and tracked as a revision.
moveToRangeEnd - This element specifies the end of a region whose move destination contents are part of a single named move.
moveToRangeStart - This element specifies the start of the region whose move destination contents are part of a single named move.
customXmlDelRangeEnd - This element specifies the end of a region in which custom XML markup has been deleted and tracked as a revision.
customXmlDelRangeStart - This element specifies the beginning of a region in which all custom XML markup has been deleted and tracked as a revision.
customXmlInsRangeEnd - This element specifies the end of a region within which all custom XML markup has been inserted and tracked as a revision.
customXmlInsRangeStart - This element specifies the beginning of a region in which all custom XML markup has been inserted and tracked as a revision.
customXmlMoveFromRangeEnd - This element specifies the end of a region within which all custom XML markup was moved to another location in the document and this move was tracked as a revision.
customXmlMoveFromRangeStart - This element specifies the start of a region within which all custom XML markup was moved to another location in the document and this move was tracked as a revision.
customXmlMoveToRangeEnd - This element specifies the end of a region within which all custom XML markup was moved to this location in the document and this move was tracked as a revision.
customXmlMoveToRangeStart - This element specifies the start of a region within which all custom XML markup was moved to this location in the document and this move was tracked as a revision.
OpenXML supports all these features when revisions are enabled for a document. Due to the record of all these data in OpenXML, we will never be losing any changes which we done to the document.
My next article will throw some light on the advantage of using OpenXML for revisions over other document formats.