111
6.1.1 Versionsandversionnumbers
Sinceachangeisapplicableinanyversionthatisadescendentoftheversioninwhichit
wasadded,ancestorqueriesareimportantinquicklydeterminingwhetheraparticular
changeispresentinaparticularversion.InVTML,thisproblemissolvedbyusingaversion
numberingscheme.Whileversionscouldbearbitrarilyidentified,structurednamingschemes
areinwideusebecausetheyenableaprogramtodeterminetherelationshipbetweentwo
versionsgivenonlytheirversionnumbers.Inparticular,itisusefultobeabletotellifa
versionisachildofanotherversion,andtocalculatetheversionnumberofthecommon
ancestoroftwoversionsgiventheirversionnumbers.VTMLversionsarerepresentedusing
“L-shaped”versionnumbers.Thisnumberingsystemhasbeen(independently)describedin
(KellerandUllman1995),whichexaminesthemintermsoftheirorderingproperties,for
integratingversionmanagementintotraditionaldatabasesystems.BeforedescribingL-
shapedversionnumbering,wewillbrieflyreviewthetwomostobviousalternatives,and
theircharacteristics.
Thefirstalternativecanbecalledoutlinenumbering.Inthissystem,asinallthefollow-
ingonesweshallexamine,therootversionisalwaysnumber1.Thefirstchildofanode,x,
willhavenumberx.1.Then-thbrotherofx.1willhavenumberx.n.Thismeansthateach
successorversionincreasesthelengthoftheversionnumber.Whilethissystemissimpleto
implement,andwhileancestortestingandcommonancestordeterminationaretrivial,this
schemeisneverused.Thisisbecauseversiontreestendtohavemanylongchains,andout-
linenumbersgrowlinearlyinthelengthofachain.
Thesecondalternativecanbecalledreverseoutlinenumbering.Inthissystem,thefirst
childofanodexwillhavenumberx+1.Thefirstsiblingofx+1willhavenumber(x+1).1.
Undertheserules,furthersiblingswillbenumberedx+1.1.1,andsoon.Inthissystem,suc-
cessorsarenumberedsequentially,solvingtheproblemoflongidentifiers,butanylarge
numberofalternativesrecreatestheproblem.
112
InL-shapednumbering,aversion’snumberisobtainedbycountingthesequenceof
downwardstepsandofrightwardsteps(L-shapedpaths)necessarytogetfromtherootto
theselectednode.Asinreverseoutlinenumbering,leftmostchildrenarecompactlyrepre-
sented,butunlikereverseoutlinenumbering,multiplealternativesarealsocompactlyrepre-
sented.
6.1.2 TheVTMLdataformat
TheformatofaVTMLdocumentisbasedonasimpletaggingscheme,conceptuallysimilar
tothatoftagginglanguageslikeXMLorSGML.
7
TheparsergeneratorinputfilefortheVTML
grammarusedinthe2.0implementationappearsinAppendixB,editedforclarity.VTMLin-
formationisrepresentedbytagswithattributes.Theattributeswithspecialsignificanceto
VTMLaresyntacticallyandsemanticallydistinguishedfrom“user”attributes,whichapplica-
tionscanusetostoreadditionalinformationneededtodescribethechangesinadocument.
Userattributesaresyntacticallydistinguishedbyaleadingunderscore,allowingforexten-
sionsofVTMLtodefinenewattributes.AVTMLfilestartswithaheaderidentifyingthefor-
mat,declaringoptions,andcontainstwoparts(bothofwhichareoptional,thoughatleast
onemustbepresent).
VTMLchangesareeitherinsertionsordeletions.Eachisassociatedwithitsinitialversion,
representedasamandatoryunlabelledattribute.EachchangealsohasachangeID,aunique

7
XMLsyntaxwould,insomeways,beidealbutcannotbeusedbecauseofitsinternationalization
features.SinceXMLrequiresadeclaredcharactersetencoding,itisunsuitableforrepresentingbinary
data,ordatawithmixedcharacterencodings.Forversionrepresentation,changingcharacterencod-
ingsisnotpossible.AsecondaryfactorinthedesignoftheVTML2.0syntaxistheconfusionresult-
ingfromshareddelimitersbetweentheVTMLlanguageanditsmostlikelycontentformats.VTMLre-
quirestheescapingofsyntacticallysignificantdatacharacters,soVTML2.0avoidstheuseofXMLand
HTMLdelimiters.
Previous Page Next Page