473,547 Members | 2,553 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Comparing two XML documents.

I am working on a migration project. There are two XML documents one in
the old system and one in the new system.
They both are identical but dynamically created from the datasource
that is being migrated.

My job is to programmaticall y compare these two documents and make sure
they are identical. I am using C#.

How can I do this? Any example, pointers will be greatly appreciated.

Thanks in advance.

Nov 3 '06 #1
3 4704
ze****@gmail.co m wrote:
I am working on a migration project. There are two XML documents one in
the old system and one in the new system.
They both are identical but dynamically created from the datasource
that is being migrated.

My job is to programmaticall y compare these two documents
This <http://msdn.microsoft. com/XML/XMLDownloads/default.aspxdow nload
section has an "XML Diff and Patch tool" that helps comparing XML documents.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 3 '06 #2
Use an XML schema with your XML document to verify the document
complies to a particular kind of format. XML schemas define the rules
for how a document is structured, and they can also define data
dependencies. After you create your schema, pass it to the XML parser
that is reading your document. The parser will then check for any
deviations in your document.

If you mean that the documents must be identical contextually, then you
can use any utility that is able to compare text files for differences.

Nov 3 '06 #3
zb
Thank you all for your direction.

XMLDiffPatch looks like the tool for me. But, help me clear this doubt
this tool will compare schema and the data in the xml (attributes and
element enclosed text)?

Hopefully, this will be the last question.:)

Thanks again.


Martin Honnen wrote:
ze****@gmail.co m wrote:
I am working on a migration project. There are two XML documents one in
the old system and one in the new system.
They both are identical but dynamically created from the datasource
that is being migrated.

My job is to programmaticall y compare these two documents

This <http://msdn.microsoft. com/XML/XMLDownloads/default.aspxdow nload
section has an "XML Diff and Patch tool" that helps comparing XML documents.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 9 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1759
by: Donal McWeeney | last post by:
Hi, Does anyone know any good tools for performing a side by side comparison of 2 xml documents on an element by element and attribute by attribute basis. Thanks Donal
4
5523
by: ddd | last post by:
I am trying to build a diff tool that allows me to compare two HTML files. I am looking for resources on how to achive this. The main problem is that I do not want to simply highlight the line of code where the change happened, but rather the word/text that changed. Example say the html file contains a table with three cells/one row, and all...
19
2628
by: Dennis | last post by:
I have a public variable in a class of type color declared as follows: public mycolor as color = color.Empty I want to check to see if the user has specified a color like; if mycolor = Color.Empty then..... or if mycolor is Color.Empty then .......
2
1125
by: Paul Bromley | last post by:
Anyone know of a LOW-COST control that will allow me to do this and EYEBALL the changes in the most recent file?? I am writing an application that allows users to view the same RTF filename in 2 places on a server, one of which may have been updated. I need to know more than which is the latest file date, and whether a file has been changed or...
2
1046
by: Rob | last post by:
Is there an easy way to compare 2 xml documents in order to see if they are identical ?
2
3445
by: kj7ny | last post by:
I am attempting to incrementally back up files using python. How can I compare a file on a hard drive to a file in a python created zip file to tell if the file has changed? Or should I be using some other method to determine if a file has changed?
0
906
by: jzinga | last post by:
I find it very hard to believe that there is no API available in C# .NET that will allow you to run diffs on XML documents! I have found the Microsoft XML Diff and Patch GUI Tool, which seems to do exactly what I want, but is only available for .NET Framework 1.1. I am using Visual Studio 2005, so I need something that can run with .NET Framework...
8
2244
by: irek.szczesniak | last post by:
Hi, I have table pairs that I need to compare, and produce another table that shows differences. I can't just open them in separate browser and look for differences, because I have many such table pairs, and so this process has to be automated. Tables can differ in a number of ways - columns and rows can be added or missing, values of...
2
2734
by: TamaThps | last post by:
I have to write a program that takes the lines of code from a .cpp as a string into an array. Then I need to compute the ratio of total lines of code to the number of comment lines, and ratio of total number of non comment and non blank lines to the total number of code. This is the void function that I am using to get these ratio's. void...
0
7510
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7703
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7947
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7463
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6032
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5362
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3473
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1050
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
748
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.