115
Change3ofversion2.0insertstheword“complex”intheplacepreviouslyoccupiedby
“simple”.Version2.1isanalternativesuccessortoversion1.0,whichalsodeletes“simple”
butreplacesitwith“confusing”instead(viachange2ofversion2.1).
((vtml"1.0"base="2.1"))
((ins"0.0")
((ins"1.0#1"pos="0"base="1.0")Thisisa
((adel"2.0#2"base="2.0"))
((ins"2.1#2"base="2.1")confusing((adel"2.1#1"
base="2.1"))
simple((adelend"2.1#1"))((adelend"2.0#2"))
((ins"2.0#3")complex)
example.))
F F F F iii ig g g gu u u ur r r re e e e 6666....1111:::: VVVVTTTTMMMMLLLL eeeexxxxaaaammmmpppplllleeee sssshhhhoooowwwwiiiinnnngggg iiiinnnntttteeeerrrrnnnnaaaallll cccchhhhaaaannnnggggeeeessss
ThedetailsofVTMLsyntaxaside,themostimportantfactoristhattheinternalchange
formatisalsosupplementedbyanexternalchangeformatthatallowschangestobere-
cordedseparatelyfromthebasedocument.
((vtml"1.0"base="2.1")
((extinsbase="2.1.1"pos="0")Thefollowingwaswrittenbydgd:))
F F F F iii ig g g gu u u ur r r re e e e 6666....2222:::: VVVVTTTTMMMMLLLL eeeexxxxaaaammmmpppplllleeee sssshhhhoooowwwwiiiinnnngggg eeeexxxxtttteeeerrrrnnnnaaaallll cccchhhhaaaannnnggggeeeessss
Figure6.2showsanextremelyshortVTMLdocumentrepresentinganupdatetothefile
above.Itconsistsofasinglechangeaddinganattributiontothetextpreviouslyentered.
Whileanentiredocumentcanbestoredintheformofexternalchanges,theyaremostuse-
fulforexpressingthedifferencesbetweenversionsorupdatesmadebyaneditingprogram.
InasystemusingVTML,asinoneusingPalimpsest,itispossibleforaddressescreatedat
differentlocationstoconflict.InVTMLsystems,however,acentralservercanintegrate
separatechanges,determiningthefinalresults.
6.2 ImplementingVTML
ThebasicideainimplementingVTMListokeepastructurefromwhichthecontentsofa
documentcanbeeasilyretrieved.Thesimpleststructureisalinearlistcontainingeach
chunkofdata,starttagandendtagintheVTMLdocument,inorder.Aprogramcantraverse
116
thelist,selectingonlyinformationcontainedinaninsertionthatispartoftheactivever-
sionandnotpartofadeletionintheactiveversion.
Comparisonoftwoversionsisquitesimple,sincetextalwaysappearsinthesameorderin
bothversions,althoughanyparticularsubstringmayappearineitherorbothversions,or
neitherone.Theresultsofacomparisoncanbesummarizedasanorderedsequenceofpairs
ofrangesinthetwoversions,withazerolengthsequenceinacorrespondenceindicatinga
deletedregion.Thisresultisaccumulatedbytraversingthestructure,enumeratingthecon-
tentsofbothversionstobecompared.Eachpointwillbecontainedbyone,both,orneither
ofthetwoversions.Thecomparisonresultcanbeaccumulatedbysimplystartinganewcor-
respondencepairanytimetheinclusionstatechangesineitherversion.Suchanindexis
sufficienttoallowparallelscrollingandhighlightingintwoversions(SeeFigure6.3).
F F F F iii ig g g gu u u ur r r re e e e 6666....3333:::: VVVVTTTTMMMMLLLL eeeeddddiiiittttoooorrrr ddddiiiiffffffff wwwwiiiinnnnddddoooowwww,,,, wwwwiiiitttthhhh ccccoooorrrrrrrreeeessssppppoooonnnnddddiiiinnnngggg ppppoooorrrrttttiiiioooonnnnssss hhhhiiiigggghhhhlllliiiigggghhhhtttteeeedddd
Previous Page Next Page