0

I have a source xml which needs to be compared against xml template(another xml file).

The following needs to be implemented,

  1. The order of the source xml needs to be transformed as per the order in the template xml.
  2. If the elements in the template xml are not found in the source xml then it should be added.

Basically what should I need to do this, compare 2 xml's and need to change one xml based on other.

I have an idea of creating XDocument with 2 xml's and by accessing xpath of source xml from template xml, Rearrange the elements and add elements if not found.

Please advise whether this is a better approach, or anything can be added into this?

  • possible duplicate of [How would you compare two XML Documents?](http://stackoverflow.com/questions/167946/how-would-you-compare-two-xml-documents) – dbc Jul 24 '15 at 13:50
  • Also see http://stackoverflow.com/questions/8096173/how-to-compare-xml-files-in-c – dbc Jul 24 '15 at 13:50

0 Answers0