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


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


<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
Dim instance As Revisions
public class Revisions : OpenXmlPartRootElement


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] 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.


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"/>

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"/>

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">
<rcft rId="2" sheetId="1"/>

end example]

Parent Elements

Root element of SpreadsheetML Shared Workbook Revision Log part

Child Elements


raf (Revision AutoFormat)


rcc (Revision Cell Change)


rcft (Revision Merge Conflict)


rcmt (Revision Cell Comment)


rcv (Revision Custom View)


rdn (Revision Defined Name)


rfmt (Revision Format)


ris (Revision Insert Sheet)


rm (Revision Cell Move)


rqt (Revision Query Table)


rrc (Revision Row Column Insert Delete)


rsnm (Revision Sheet Name)


[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


Revisions Members

DocumentFormat.OpenXml.Spreadsheet Namespace