vcurtis
asked on
c# compare to xml files to find the difference
Hello
I have two xml files and I want to print the difference between the two (finding the updates). Has anyone done this before? Does anyone have a script they care to share
I have two xml files and I want to print the difference between the two (finding the updates). Has anyone done this before? Does anyone have a script they care to share
How detailed are you trying to go? Are you going to compare elements by namespace as well, or is this just more of a textual comparison? If the latter, why not just download a file compare utility and invoke it via the Process class?
ASKER
First, thank you for taking the time
I want to compare elements. I have name address phone city and state for each. I need to compare yesterdays files with today and identify when one has been updated.
I want to compare elements. I have name address phone city and state for each. I need to compare yesterdays files with today and identify when one has been updated.
Understood, but are namespaces involved? Is it possible to post an example of the XML, and maybe the schema (if one is defined)?
ASKER
Requested file uploaded.
Members.xml
Members.xml
I believe käµfm³d's suggestion about textual comparison is OK for such files.
However, I'd write a utility that compares element (text nodes) values. This should be pretty straightforward.
We went this way (some years ago) when we had to compare pretty big and rather complex xml files.
However, I'd write a utility that compares element (text nodes) values. This should be pretty straightforward.
We went this way (some years ago) when we had to compare pretty big and rather complex xml files.
ASKER
Yes, I get the idea. Just do not know how it is done. Was hoping to get some assistance. I am new to this and the boss is acting like I have been doing it for years
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Can you post the schema of the XML as well an actual copy of the XML file.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you so much, you just made me the hero of my company " Until the next problem comes up that is"