473,387 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Microsoft XML Diff/Patch -- how to output differences

Thanks to this newsgroup I've been pointed to Microsoft's XML Diff & Patch
utilities. I've been reading about how I can use the tools to generate a
diffgram between two XML documents, and how the XML Patch utility can (for
example) bring document A in line with document B. Very cool.

However, I was wondering if there's any way I can use the diffgram to
generate something else; a third type of document that highlights the
differences between the the input docs and is a little more readable than a
diffgram would be ideal. Where I can see actual node names instead of node
match numbers, for instance.

Even if I could get a document that shows what XML Patch would do; the new
nodes added, or nodes deleted, or values changed, I'd be happy. The XML
patch demo site at http://apps.gotdotnet.com/xmltools/xmldiff/default.aspx
has a nice colored comparison between the two files, and would be terrific
for my purposes, but I can't find any source code on how they did it.

Has anyone done something like this before? I'm open to suggestions.
Thanks!
Jul 18 '06 #1
7 21865
Steve Hershoff wrote:
Even if I could get a document that shows what XML Patch would do; the new
nodes added, or nodes deleted, or values changed, I'd be happy. The XML
patch demo site at http://apps.gotdotnet.com/xmltools/xmldiff/default.aspx
has a nice colored comparison between the two files, and would be terrific
for my purposes, but I can't find any source code on how they did it.
http://msdn.microsoft.com/library/de...ml/xmldiff.asp

explains using the DiffPatch tool and has a link to download Xmldiffpatch.exe which contains the source.

Note that there are a few bugs (as posted in the discussion forums). You can also download my ComXT tool from
http://www.gotdotnet.com/Community/U...D-48A81BE0298F

for an example of using the XmlDiffPatch DLLs (and contains my modified XmlDiffPatch DLLs which correct a couple of the bugs).

--
Take care,
Ken
(to reply directly, remove the cool car. <sigh>)
Jul 19 '06 #2
This looks great, Ken. Many thanks.

As an aside, I'm wondering if it's possible for me to tweak things, so that
two XML files are "different" only if they have extra or missing nodes.

As an example, if two documents had two nodes at the same point in their
trees that looked like this:

document 1:
<add key="Contact" value="jo*@myspace.com"/>
document 2:
<add key="Contact" value="da***@craigslist.org"/>
.....I'd like to consider them as not different.

.. I'm more interested in the structure, not value content, of the files.
I've browsed the source code for XML diff and it's a little daunting, so I
was wondering if anyone knew which sections I might zero in on to accomplish
this, if it's possible. Thanks again.


"Ken Arway" <ka****@jaguar.att.netwrote in message
news:uI**************@TK2MSFTNGP03.phx.gbl...
Steve Hershoff wrote:
>Even if I could get a document that shows what XML Patch would do; the
new nodes added, or nodes deleted, or values changed, I'd be happy. The
XML patch demo site at
http://apps.gotdotnet.com/xmltools/xmldiff/default.aspx has a nice
colored comparison between the two files, and would be terrific for my
purposes, but I can't find any source code on how they did it.

http://msdn.microsoft.com/library/de...ml/xmldiff.asp

explains using the DiffPatch tool and has a link to download
Xmldiffpatch.exe which contains the source.

Note that there are a few bugs (as posted in the discussion forums). You
can also download my ComXT tool from
http://www.gotdotnet.com/Community/U...D-48A81BE0298F

for an example of using the XmlDiffPatch DLLs (and contains my modified
XmlDiffPatch DLLs which correct a couple of the bugs).

--
Take care,
Ken
(to reply directly, remove the cool car. <sigh>)

Jul 19 '06 #3
Steve,
If you are intertested in the structure only, then should you not use the
XML DIff tool to compare the XSD of the XML and not the XML data itself?.

"Steve Hershoff" wrote:
This looks great, Ken. Many thanks.

As an aside, I'm wondering if it's possible for me to tweak things, so that
two XML files are "different" only if they have extra or missing nodes.

As an example, if two documents had two nodes at the same point in their
trees that looked like this:

document 1:
<add key="Contact" value="jo*@myspace.com"/>
document 2:
<add key="Contact" value="da***@craigslist.org"/>
.....I'd like to consider them as not different.

.. I'm more interested in the structure, not value content, of the files.
I've browsed the source code for XML diff and it's a little daunting, so I
was wondering if anyone knew which sections I might zero in on to accomplish
this, if it's possible. Thanks again.


"Ken Arway" <ka****@jaguar.att.netwrote in message
news:uI**************@TK2MSFTNGP03.phx.gbl...
Steve Hershoff wrote:
Even if I could get a document that shows what XML Patch would do; the
new nodes added, or nodes deleted, or values changed, I'd be happy. The
XML patch demo site at
http://apps.gotdotnet.com/xmltools/xmldiff/default.aspx has a nice
colored comparison between the two files, and would be terrific for my
purposes, but I can't find any source code on how they did it.
http://msdn.microsoft.com/library/de...ml/xmldiff.asp

explains using the DiffPatch tool and has a link to download
Xmldiffpatch.exe which contains the source.

Note that there are a few bugs (as posted in the discussion forums). You
can also download my ComXT tool from
http://www.gotdotnet.com/Community/U...D-48A81BE0298F

for an example of using the XmlDiffPatch DLLs (and contains my modified
XmlDiffPatch DLLs which correct a couple of the bugs).

--
Take care,
Ken
(to reply directly, remove the cool car. <sigh>)


Jul 20 '06 #4
Hi Ganesh,

Does the XML Diff tool output an XSD? I thought it only created a DiffGram.
"Ganesh Muthuvelu" <Ga*************@discussions.microsoft.comwrote in
message news:22**********************************@microsof t.com...
Steve,
If you are intertested in the structure only, then should you not use the
XML DIff tool to compare the XSD of the XML and not the XML data itself?.

Jul 20 '06 #5
Hi Ken,

I am also interested in similar tool but as I understand that XML
diff/patch tool does the diff/patching automatically. But I would like to
give this decision to the end user to decide which node out of the 2 XML
file they want to select in the merged XML file, just like clearcase
xmldiffmrg.exe tool for merging XML files. Do you think it can be possible
to tailored XML diff/patch tool to do this job?

Regards
Sanjib

"Ken Arway" <ka****@jaguar.att.netwrote in message
news:uI**************@TK2MSFTNGP03.phx.gbl...
Steve Hershoff wrote:
>Even if I could get a document that shows what XML Patch would do; the
new nodes added, or nodes deleted, or values changed, I'd be happy. The
XML patch demo site at
http://apps.gotdotnet.com/xmltools/xmldiff/default.aspx has a nice
colored comparison between the two files, and would be terrific for my
purposes, but I can't find any source code on how they did it.

http://msdn.microsoft.com/library/de...ml/xmldiff.asp

explains using the DiffPatch tool and has a link to download
Xmldiffpatch.exe which contains the source.

Note that there are a few bugs (as posted in the discussion forums). You
can also download my ComXT tool from
http://www.gotdotnet.com/Community/U...D-48A81BE0298F

for an example of using the XmlDiffPatch DLLs (and contains my modified
XmlDiffPatch DLLs which correct a couple of the bugs).

--
Take care,
Ken
(to reply directly, remove the cool car. <sigh>)

Jul 24 '06 #6
Sanjib Biswas wrote:
I am also interested in similar tool but as I understand that XML
diff/patch tool does the diff/patching automatically. But I would like to
give this decision to the end user to decide which node out of the 2 XML
file they want to select in the merged XML file, just like clearcase
xmldiffmrg.exe tool for merging XML files. Do you think it can be possible
to tailored XML diff/patch tool to do this job?
I doubt that can be done, but the best place to ask the question is in the Extreme XML Column Discussions on GotDotNet:

http://www.gotdotnet.com/community/m...rd.aspx?id=207

--
Take care,
Ken
(to reply directly, remove the cool car. <sigh>)
Jul 25 '06 #7
Hi,
I am working on a functionality wherein the user can approve of reject
the changes made to an xml file (say, old.xml)and create a new xml file
(new.xml) with all the approved changes.

The only difference between my application and the xml diff/patch
application is that the diff/patch utility consideres all changes to be
approved and creates the new.xml. I would like to add one layer in
between and give the user the ability to approve or reject. Any ideas
in this regard will be very much appriciated.

Thanks
Naveen

*** Sent via Developersdex http://www.developersdex.com ***
Aug 24 '06 #8

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

Similar topics

2
by: Charley | last post by:
I've got a diff file that I think is a patch for a bunch of file in a directory. How do I apply this file? I thought it was #patch myfile.diff But that does nothing. I must be missing...
3
by: Nick Allen | last post by:
After using ndiff from difflib, the function restore would return the sequence that generated the delta. Unfortunately, restore does not do the same for unified_diff. I do not see any similar...
8
by: TonyHa | last post by:
Hello, Does any one have using Python to write a Unix "diff" command for Window? Tony Ha.
9
by: Ching-Lung | last post by:
Hi all, I try to create a tool to check the delta (diff) of 2 binaries and create the delta binary. I use binary formatter (serialization) to create the delta binary. It works fine but the...
4
by: Andreas Kasparek | last post by:
Hola! I'm preparing my master thesis about a XML Merge Tool implementation and was wondering if there is any open standard for XML diff regarding topics like: - is a diff result computed on...
3
by: Csaba Gabor | last post by:
I'm comparing the text of (snippets of) web pages which I expect to be quite different or quite similar. In the case where they are similar, I would like to display the more recent one and say...
0
by: KJ | last post by:
Helo All, Does anyone out there have any example XSLT files (that they'd like to share) which transform difgrams produced by the Xml Diff and Patch tool into a nice format? This would be most...
1
by: erikcw | last post by:
Hi, I'm trying to create an undo/redo feature for a webapp I'm working on (django based). I'd like to have an undo/redo function. My first thought was to use the difflib to generate a diff to...
6
by: Aaron Gray | last post by:
Hi, I am working on an HTML WYSISYG Wiki and need to display a diff page like WikiPedia does if two people edit a file at the same time to give the second user the diff. Basically with additions...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...

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.