I have 2 XML files with data about same items, that are kept on client and server. Some of the data are the same, some attributes/sub-elements are different on client compared to server.
Client data look like this (with more attributes that are irrelevant to the comparison):
<item id="1" create_dttm="05/28/2010 12:00:00 AM" name="Correct_Name">
<text1>sample</text1>
<icon>iconurl</icon>
</item>
Server data look like this (with more attributes and possible sub-elements):
<item type="4" id="1" name="mispelled_name">
</item>
Because matching for the items is done via the ID in our code, people that did data entry for the server.xml were not very careful with the names, leaving in typos or placeholder names. This does not cause bugs, however i would prefer to be on the safe side and make sure all the misspelled entries in server.xml to be replaced by correct names from the client.xml (those are double checked and are all correct)
Is it possible to run some script/code/xslt stylesheet to replace the names in the server.xml with the names from the client.xml?
I am not very familiar with stylesheets and not sure where to begin with coding something like that
Basically i want it to look like this:
Read client.xml
Read server.xml
For each item in client.xml, read attributes "id" and "name"
find item with same "id" in server.xml
replace "name" in server.xml with value from client.xml for the item with that "id"
Thank you for any help you can provide