Click here to Skip to main content
15,900,973 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am looking about how to maintain same version of xml config in both client and server. Meaning I want to make sure at any point of time, xml config maintained in server for that client is same in client application. i.e Client and server should have same version, so that if server publish new changes client should accept as such and use it. Mean while client also can change the values but not tags. Especially doing this in .Net.

Do we need to use xml schema to do this or any other simple way there?

thanks in advance.

Basically, you should evolve your XML schema only in incremental manner. Besides, you should include version information in the XML itself.

Consider the case when some assembly is newer than the schema of the XML file. If the changes are incremental, the data will lack several item. The code will still process it and new data items will keep their default values. If the assembly reads the XML file, and its schema is newer then the assembly, the code should issue the error message telling the user that the code is obsolete and should be updated.

If you have some obsolete data items (which are not significant in newer version of the code), you should not remove them from schema. You can devise some deprecation mechanism instead. If the obsolete data items presents in older XML, it will be simply ignored with the code, but if the code creates new XML file from the data stored in memory of the newer application, should be skipped in XML, even though they exist in the scheme. You could, for example, use some special "obsolete" or "deprecated" attribute at your data member in you data contract.

These are just general ideas summarizing pretty long experience of maintaining versions of code and data. You can review them and devise your own versioning model.

Share this answer

Thanks for the answer. But I am looking for what is the best to have same version of xml config maintained in client and server, where server has rights to update the config, as well client can update via UI the config value. But both has to make sure its updated and maintained the same.

Do we need to use schema validation or just simple xml with version in it as you suggest should be fine ?

Share this answer
Richard C Bishop 7-Aug-13 14:52pm    
Be mindful of where you are posting items. In this instance you have posted a comment/question as a solution to your original question. Paradoxical?
DavJes 9-Aug-13 3:27am    
sorry about that
Richard C Bishop 9-Aug-13 10:30am    
No worries, just a friendly comment so that you may avoid down-voting and abuse reports.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900