.net - Reconcile XML Updates -


i have set xml files store simple bits of data. in each case data in files structured differently, storing different types of data, simple. there file on server, can either downloaded , updated offline or updated online. here's problem: happens if while user has file offline updating file updated , want upload changes server? there way handle preferably in .net? worth nothing changes not frequent. in cases new file created major changes; we're talking minor update older files , want plan update collision if happens.

for example:

original file:

 [person]   [name]bob[/name]   [address]123 street[/address]   [phone]123-456-7890[/phone] [/person] 
changes made offline:
 [person]   [name]bob[/name]   [address]124 street[/address]   [phone]123-456-7890[/phone] [/person] 

changes made online:

 [person]   [name]bob[/name]   [address]123 street[/address]   [phone]124-456-7890[/phone] [/person] 

ideal result:

 [person]   [name]bob[/name]   [address]124 street[/address]   [phone]124-456-7890[/phone] [/person] 

on occasions there new elements merged in base file. have option structure xml files want, can add in attribute sort of element id if help, i'd prefer not have that.

thanks help. if there other suggestions on how manage scenario don't involve xml i'm open ideas well.

i think adding unique identifier (i.e. guid) each snippet may simplest way , accurately merge documents. if these files programmaticaly edited, can create guid on server or offline client new snippests , not need worry collisions. such system easier debug , maintain system attempts identify whether snippet has changed or new.

i'm not aware of built in libraries can identify large scale changes text. might hook subversion or other source control library has code determining how text has changed think overly complicated required.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -