As your folks who worked with the 2003 wordprocessingml format have probably noticed by now, there are a new set of attributes/elements in the open XML wordprocessingml format that shows up all over the place. i'm talking about rsids.
The rsid element is used to allow applications to more than tively merge two documents that have forked. it's best to use an example for explaining the use, so let's image I have a document that has the following text (we'll call this document"Brian1"):
Clearly this is a great thing for the industry. I personally feel like it's really cool. We now have an official standard that provides all the details necessary to read and write office documents ENTs.
I then send this document out to my coworker Steve to review and make changes. steve decides that he wants to add in a bit of a sarcastic remark for the first sentence so when he sends back the document it looks like this (We'll call it"Steve1"):
Clearly this is a great thing for the industry (unless you happen to be one of those folks who had investments in growing this myth that there was some kind of "file format war" underway ). I personally feel like it's really cool.
We now have an official standard that provides all the details necessary to read and write office documents.
While Steve was reviewing his copy of the document, I also made some changes. I removed that second sentence, so now my document looks like this (We'll call it"Brian2"):
Clearly this is a great thing for the industry. We now have an official standard that provides all the details necessary to read and write office documents.
Now, when Steve sends me his copy back, I 'd like to have my word processor Merge My document and his so that I get the most up to date version with both of our edits. ultimately, the merged document wowould look like this (We'll call it"Final"):
Clearly this is a great thing for the industry
(Unless you happen to be one of those folks who had investors in growing this myth that there was some kind of "file format war" underway ).
I personally feel like it's really cool. We now have an official standard that provides all the details necessary to read and write office documents.
The blue text is tracked as an insertion and the red text is a deletion.
Now, why is this example interesting at all? Well, if we only stored the basic text of this document, it wocould be very difficult to merge. in looking at the difference between "brian2" and "steve1", how wowould the application know what was an insertion and
What was a deletion? If I still had my original file ("brian1"), it wocould be easy to track this, But that's most likely not the case. I only have my edited document "brian2", and Steve's document "steve1 ". how do you know that the text "I personally feel like
It's really cool "wasn' t something that Steve added, as opposed to something that I deleted?
One way you can do this is via "track changes" functionality, where the application tracks the insertions and deletions as they happen and stores that in the format, but this often isn't desired. often, for privacy reasons, people don't want to have
Revisions tracked in their documents. Instead, they just want to be able to merge the documents later, and have the application figure out what was inserted, and what was deleted.
Well, the way we deal with this is through revision Identifiers (rsids ). every time a document is opened and edited a unique ID is generated, and any edits that are made get labeled with that ID. this doesn't track who made the edits, or what date they were
Made, but it does allow you to see what was done in a unique session. the list of rsids is stored at the top of the document, and then every piece of text is labeled with the rsid from the session that text was entered.
This approach is what allows us to properly merge the two documents. when we merge documents, we can see what rsids the two documents share. any shared rsids will represent text that was entered before the document was forked. any rsids that are unique
One of the specified ents represent edits that were made after it was forked.
This means that if we see text in one document, but not in the other, all we need to do is look at the rsid applied to that text. if it's one of the shared rsids, that means the text existed before the documents were forked. that also means that when we
Merge the statements, we can assume that the text was deleted from one of the statements, rather than added to the other.
Let's go back to our example. In the original file, the XML wocould look something like this:
<W: Body>
<W: PW: rsidrdefault ="00544fob">
<W: r>
<W: T> clearly this is a great thing for the industry. I personally feel like it's really cool. We now have an official standard that provides all the details necessary
Read and Write office documents. </W: T>
</W: r>
</W: P>
</W: Body>
This is saying that all runs (<W: r>) in the paragraph by default have the rsid "00544fob ". and in the document settings, we wowould have "00544fob" listed as one of the rsids for the document. (Note that there are a number of other places that rsids show up,
But we're only focusing on the text for this case ).
Now, after the document went to Steve, and he made his edits, the document "steve1" wocould look like this:
<W: Body>
<W: PW: rsidrdefault ="00544fob">
<W: r>
<W: T> clearly this is a great thing for the industry </W: T>
</W: r>
<W: RW: rsidr ="00ff1f58">
<W: T> (unless you happen to be one of those folks who had investors in growing this myth that there was some kind of "file format war" underway) </W: t>
</W: r>
<W: r>
<W: T>. I personally feel like it's really cool. we now have an official standard that provides all the details necessary to read and write office documents. </W: T>
</W: r>
</W: P>
</W: Body>
Notice that while the formatting properties on all three runs are the same, the rsid values are different. this happens because Steve added that additional text, so it was assigned to a new rsid value "00ff1f58 ". if you look in the document settings
This document, there will be two rsids: "00544fob" and "00ff1f58 ".
Now, separately I opened my copy and deleted some text. So the document "brian2" is going to look like this:
<W: Body>
<W: PW: rsidrdefault ="00544fob">
<W: r>
<W: T> clearly this is a great thing for the industry. We now have an official standard that provides all the details necessary to read and write office documents. </W: T>
</W: r>
</W: P>
</W: Body>
Notice that the runs in the paragraph all have the same rsids still. there aren't any new rsids in the body because I didn't add any text. I did however edit the document, so if you look in the document settings, there will be a new rsid. so in "brian2 ",
We have the following two rsids: "00544fob" and "00a95ba5 ".
So, when we go to generate the "final" document, we merge "brian2" with "steve1 ". as we merge the two documents, we see that they share the rsid "00544fob", but that all other rsids are unique to those copies. this means that any text with the rsid "00544fob"
Existed in the original file, and any other text was added after the fork. there are two pieces of text in Steve's document that aren't in mine. the first piece of text that reads
"(Unless you happen to be one of those folks who had investors in growing this myth that there was some kind of "file format war" underway)"Was an addition made by Steve, rather than something I deleted.
That text had an rsid unique to Steve's document. The other text that reads:
"I personally feel like it's really cool ."On the other hand has an rsid that is shared between the two statements. That tells us that it was deleted from my copy, rather than added to Steve's.
So, next time you're looking at a wordprocessingml document and you're wondering why it's broken out of into so unknown runs, you're all know the answer. this is another example of how the simplicity of the flat schema wordprocessingml uses makes it easy to add Properties
To the various runs of text. the rsid isn't a iner, but rather just a property of the text. if we had the ability to nest runs within other runs (similar to the HTML <span> model), then it wocould be a bit more complicated (not impossible, just more complicated ).
The architecture of a Wordprocessing file is much simpler. Since runs can be nested in other runs, you have a more predictable ancestor list to walk through when finding the properties of that particle run.
If you wowould rather not have these rsids in your files, it's easy enough to turn off. just go to the trust center and turn off the setting: "store random number to improve combine accuracy"
Two other important things to note. first is that the rsid tells us nothing about the time or order things were done. they are completely random, and are only used for seeing where things match. so they aren't of much use unless you are merging with another
Document that also has rsids. Another thing to note is that these are not just used for content, but other settings as well like styles, layout, etc.