Revisions Class

Revisions. It is the root element of WorkbookRevisionLogPart.When the object is serialized out as xml, its qualified name is x:revisions.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.OpenXmlPartRootElement
        DocumentFormat.OpenXml.Spreadsheet.Revisions

Namespace:  DocumentFormat.OpenXml.Spreadsheet
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
<ChildElementInfoAttribute(GetType(RevisionFormat))> _
<ChildElementInfoAttribute(GetType(RevisionCellChange))> _
<ChildElementInfoAttribute(GetType(RevisionAutoFormat))> _
<ChildElementInfoAttribute(GetType(RevisionMove))> _
<ChildElementInfoAttribute(GetType(RevisionCustomView))> _
<ChildElementInfoAttribute(GetType(RevisionSheetName))> _
<ChildElementInfoAttribute(GetType(RevisionInsertSheet))> _
<ChildElementInfoAttribute(GetType(RevisionRowColumn))> _
<ChildElementInfoAttribute(GetType(RevisionDefinedName))> _
<ChildElementInfoAttribute(GetType(RevisionComment))> _
<ChildElementInfoAttribute(GetType(RevisionQueryTable))> _
<ChildElementInfoAttribute(GetType(RevisionConflict))> _
Public Class Revisions _
    Inherits OpenXmlPartRootElement
'Usage
Dim instance As Revisions
[ChildElementInfoAttribute(typeof(RevisionFormat))]
[ChildElementInfoAttribute(typeof(RevisionCellChange))]
[ChildElementInfoAttribute(typeof(RevisionAutoFormat))]
[ChildElementInfoAttribute(typeof(RevisionMove))]
[ChildElementInfoAttribute(typeof(RevisionCustomView))]
[ChildElementInfoAttribute(typeof(RevisionSheetName))]
[ChildElementInfoAttribute(typeof(RevisionInsertSheet))]
[ChildElementInfoAttribute(typeof(RevisionRowColumn))]
[ChildElementInfoAttribute(typeof(RevisionDefinedName))]
[ChildElementInfoAttribute(typeof(RevisionComment))]
[ChildElementInfoAttribute(typeof(RevisionQueryTable))]
[ChildElementInfoAttribute(typeof(RevisionConflict))]
public class Revisions : OpenXmlPartRootElement

Remarks

The following table lists the possible child types:

  • RevisionRowColumn <x:rrc>

  • RevisionMove <x:rm>

  • RevisionCustomView <x:rcv>

  • RevisionSheetName <x:rsnm>

  • RevisionInsertSheet <x:ris>

  • RevisionCellChange <x:rcc>

  • RevisionFormat <x:rfmt>

  • RevisionAutoFormat <x:raf>

  • RevisionDefinedName <x:rdn>

  • RevisionComment <x:rcmt>

  • RevisionQueryTable <x:rqt>

  • RevisionConflict <x:rcft>

[ISO/IEC 29500-1 1st Edition]

18.11.1.16 revisions (Revisions)

This element represents the root node of a list of revisions made in this shared workbook. This root node shows up at the beginning of every log file that contains specific revisions made to the workbook.

When multiple users are sharing, and editing, a workbook at the same time, there can be conflicting changes. The spreadsheet application should have logic to resolve such conflicts, and the file format should only contain enough information so that the spreadsheet application can restore the workbook to the correct state after conflict resolution. Revisions can also be tracked by the spreadsheet application for review by the user at a later time (as opposed to only dealing with conflicts on a save event.) Some edits to workbooks are made as a result of this conflict resolution. So, there are cases where a revision is effectively undone by another user, and as a result that undoing is itself a revision that adds or changes data in the file. These operations are tracked by the ua and ra attributes of many different elements.

[Example:

Step 1:

User 1 inserts Column A. So the XML in the revision log would look like this:

<revisions xmlns="…" xmlns:r="…">
<rrc rId="1" sId="1" ref="A1:A1048576" action="insertCol"/>
</revisions>

Step 2:

User 2 synchronizes the file to pick up that change, but then activates the Track Changes feature, and rejects that change. This effectively performs an undo on User 1's insertion. This is denoted in the file with the ua attribute meaning that this change happened as the result of an undo. The XML for the revision log would look like this:

<revisions xmlns="…" xmlns:r="…">
<rrc rId="2" ua="1" sId="1" ref="A1:A1048576" action="deleteCol"/>
<rcft rId="1" ua="1" sheetId="1"/>
</revisions>

Step 3:

User 1 enters "foo" in A1, and saves the file. A conflict resolution dialog is shown since User 2's version of the file removed the inserted Column A. User 1 chooses to accept their own changes. This undoes the change that User 2 made. So, in effect, it performed an undo on a previous undo operation. This is denoted in the file format by the ra attribute meaning that a the change occurred because a previous undo was undone. So the resulting XML for the newest log file looks like this:

<revisions xmlns="…" xmlns:r="…">
<rrc rId="3" ua="1" ra="1" sId="1" ref="A1:A1048576" action="insertCol"/>
<rcft rId="2" ua="1" sheetId="1"/>
<rcc rId="4" sId="1">
<nc r="A1" t="inlineStr">
<is>
<t>foo</t>
</is>
</nc>
</rcc>
<rcft rId="2" sheetId="1"/>
</revisions>

end example]

Parent Elements

Root element of SpreadsheetML Shared Workbook Revision Log part

Child Elements

Subclause

raf (Revision AutoFormat)

§18.11.1.8

rcc (Revision Cell Change)

§18.11.1.9

rcft (Revision Merge Conflict)

§18.11.1.10

rcmt (Revision Cell Comment)

§18.11.1.11

rcv (Revision Custom View)

§18.11.1.12

rdn (Revision Defined Name)

§18.11.1.13

rfmt (Revision Format)

§18.11.1.17

ris (Revision Insert Sheet)

§18.11.1.18

rm (Revision Cell Move)

§18.11.1.19

rqt (Revision Query Table)

§18.11.1.20

rrc (Revision Row Column Insert Delete)

§18.11.1.21

rsnm (Revision Sheet Name)

§18.11.1.22

[Note: The W3C XML Schema definition of this element’s content model (CT_Revisions) is located in §A.2. end note]

© ISO/IEC29500: 2008.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Revisions Members

DocumentFormat.OpenXml.Spreadsheet Namespace