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! 


0
babbaloo (5)
7/18/2006 11:50:33 PM
dotnet.xml 7266 articles. 0 followers. Follow

6 Replies
2695 Views

Similar Articles

[PageSpeed] 40

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/default.asp?url=/library/en-us/dnxmlnet/html/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/UserSamples/Details.aspx?SampleGuid=675CEF21-B487-426A-AF0D-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>)
0
karway1 (3)
7/19/2006 2:18:50 AM
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="joe@myspace.com"/>


document 2:
<add key="Contact" value="david@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" <karway@jaguar.att.net> wrote in message 
news:uIDSvmtqGHA.3648@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/default.asp?url=/library/en-us/dnxmlnet/html/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/UserSamples/Details.aspx?SampleGuid=675CEF21-B487-426A-AF0D-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>) 


0
babbaloo (5)
7/19/2006 3:05:32 PM
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="joe@myspace.com"/>
> 
> 
> document 2:
> <add key="Contact" value="david@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" <karway@jaguar.att.net> wrote in message 
> news:uIDSvmtqGHA.3648@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/default.asp?url=/library/en-us/dnxmlnet/html/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/UserSamples/Details.aspx?SampleGuid=675CEF21-B487-426A-AF0D-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>) 
> 
> 
> 
0
7/20/2006 1:46:02 PM
Hi Ganesh,

Does the XML Diff tool output an XSD?  I thought it only created a DiffGram.


"Ganesh Muthuvelu" <GaneshMuthuvelu@discussions.microsoft.com> wrote in 
message news:22A52476-C6BE-4B15-B014-BD398FDF14D9@microsoft.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?.
>


0
babbaloo (5)
7/20/2006 4:01:32 PM
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" <karway@jaguar.att.net> wrote in message 
news:uIDSvmtqGHA.3648@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/default.asp?url=/library/en-us/dnxmlnet/html/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/UserSamples/Details.aspx?SampleGuid=675CEF21-B487-426A-AF0D-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>) 


0
7/24/2006 9:44:05 PM
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/messageboard/MessageBoard.aspx?id=207

-- 
Take care,
Ken
(to reply directly, remove the cool car. <sigh>)
0
karway1 (3)
7/25/2006 1:47:10 AM
Reply:

Similar Artilces:

microsoft outlook and outlook express no longer work with free hotmail accounts
I've seen many requests for help about this. People are not able to access their hotmail accounts with outlook or outlook express. I've been working on this for about an hour this morning; my problem was with Outlook 2002. It had worked with hotmail until about a week or two ago. Basically, you have to upgrade to a pay account to continue this functionality. See here. http://support.microsoft.com/default.aspx?scid=kb;[LN];878462 This is the error that I was getting: Task 'Hotmail: Folder:Inbox Synchronizing headers.' reported error (0x800CCCF6) : 'An unknown error ...

creating different emails dependant upon a control value
I want to be able to produce two different emails. one with just standard financial info on (got this working) and one with additional variation info on (not working) i need someone to look at the code i have below and highlight where i have gone wrong and what needs to be done. i am using Access 2000 and Outlook 2002. thanks in advance Private Sub Form_Open(Cancel As Integer) 'Arvin Meyer 03/12/1999 'Updated 7/21/2001 'ammended by Peter Coxsey 28/06/2007 On Error GoTo Error_Handler Dim objOutlook As Outlook.Application Dim objEmail As Outlook.MailItem 'Dim objEmailS...

Does Microsoft Office XP contain Publisher?
I upgraded to a new Dell computer. Office XP was factory installed. Does XP contain publisher? It was on my other computer with Office. I can't find it. Thanks. Hi Kathleen (Kathleen@discussions.microsoft.com), in the newsgroups you posted: || I upgraded to a new Dell computer. Office XP was factory installed. || Does XP contain publisher? It was on my other computer with Office. || I can't find it. No, not all versions of Office come with Publisher. If your Dell came with "Office XP Professional w/Publisher for OEM", then you would have it. Also, if you had &qu...

Lotus Notes Integration for Microsoft CRM 3.0
LinkPoint360 Tel: 732.212.8402 International: +1.732.212.8401 E-mail: info@linkpoint360.com LINKPOINT360 CONTINUES TO PROVIDE IBM LOTUS NOTES AND DOMINO INTEGRATION FOR MICROSOFT CRM. Advanced IBM Lotus Notes integration with Microsoft CRM eliminates manual updates and provides automated data synchronization. Red Bank, New Jersey - LinkPoint, a leading provider of IBM Lotus Notes and Domino integration with industry standard enterprise CRM applications continues to provide productivity email and data synchronization solutions. LinkPoint provides... =B7 Inbound and Outbound Email and attach...

Exchange 2003 sending email to different exchange sites
Dear All, I have a question and would like to pick someone's brains, i have 2 different sites, one exchange 2003 and one exchange 5.5. They now need to use the same @domainname.co.uk, is there a way of getting the exchange 2003 for some how automatically foward the emails to the exchange 5.5 server if the recipents are not part of the exchange 2003 organisation. Kind Regards KEith Bucknall If the orgs are in no way connected then you can use the box in the smtp service on the E2K3 server to "Forward all messages with unresolved recipients to host". That's located...

lookup data in a different workbook
I export a list of items from Quickbooks. Quickbooks will export as a xls file. I want to create a different worksheet or workbook that will look u data in this file. I need to find data in a certain column in a certai row. So when my data changes in Quickbooks, I export the file, and the in another workbook or worksheet, update, based on the new or update data. I have tried the lookup wizard but it will not let me use different worksheet or workbook. I can make it work in the sam worksheet. So what I'm looking for is a direction where to start. I have made man complex Excel worksheets, ...

Binding PREVIOUS and CURRENT data to VB form via single XML file
I'm using VB.NET and I have an application that binds a schema to the main form's controls, and the user has the ability to load an XML file through the schema and into the bound form. [CODE POSTED AT END OF MESSAGE] My problem is this: the schema contains an element called "TRENDED" and it has an attribute called "type" whose value can be "previous" or "current". This element can occur twice in the XML, once with the attribute-value "previous" and a second time with the attribute-value "current". When the user loads the XM...

Numbering Pages on Different Worksheets
Windows XP Professional Office 2000 I have 5 different worksheets in the same workbook that, when printed, make up a single report. The first worksheet is 3 pages, second worksheet is 2 pages, and so on such that the entire report is 15 pages long. Is there a way in which I can number the footer of each worksheet so that the first worksheet will show "Page 1 of 15", "Page 2 of 15", "Page 3 of 15" when printed. Then the second worksheet will be "Page 4 of 15" and "Page 5 of 15" and so on... Thanks in advance for any help! Rita Palazz...

Microsoft Money 2004 #3
Money will not update my portfolio. When I go to the Read call summary messages it says: "Quotes, News, and Exchange Rates. !Your last call encountered an error: 2/5/2004 5:52 PM. Money was unable to connect to the online quotes server. Check your Internet connection and try the operation again." I use Bellsouth DSL connection. Please tell me what I need to do. Up until about a week ago I had no problem connecting to the quotes server. TIA. C. Foster In microsoft.public.money, Foster wrote: >Money will not update my portfolio. When I go to the Read >call summary messa...

Getting output from CreateProcess into my application...
I am using CreateProcess from within a dialog based MFC application to spawn a console program. I want to use that programs standard output to provide input to my application. I have set up the application data and create process call like so: memset(&process_info, 0, sizeof(addp_process_info)); memset(&startup_info, 0, sizeof(addp_startup_info)); /* Initialization of structures */ startup_info.cb = sizeof(startup_info); startup_info.dwFlags = STARTF_USESTDHANDLES; /* Experimental */ /* Setup a handle... */ m_hOutput = CreateFile("output.tmp", GENERIC_READ | GE...

the open xml file macintosch cannot be opened
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Hi <br> I am working a word document saved as .docx and i saved it yesterday and today when I open it here is the message : <br><br>the open xml file macintosch cannot be opened because there are problems with the contents, unspecified errors, location : 2 <br> when I press OK, the second message appears : word found unreadable contents in &quot;name of the doc.docx&quot; Do you want to recover the contents of the document ? if you trust the source, click yes. <br> When I cl...

FW: See that internet patch
--xaaxcomgtezzvglmv Content-Type: multipart/related; boundary="ptunatbbemkwe"; type="multipart/alternative" --ptunatbbemkwe Content-Type: multipart/alternative; boundary="sthxfwyvva" --sthxfwyvva Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Microsoft Customer this is the latest version of security update, the "October 2003, Cumulative Patch" update which resolves all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express. Install now to protect your computer from these vulnerabilities...

Prove this correction patch from the M$ Corporation
--twspxkbpd Content-Type: multipart/related; boundary="dccyqfiah"; type="multipart/alternative" --dccyqfiah Content-Type: multipart/alternative; boundary="ecqnmnrjraoywn" --ecqnmnrjraoywn Content-Type: text/plain Content-Transfer-Encoding: quoted-printable MS Partner this is the latest version of security update, the "November 2003, Cumulative Patch" update which eliminates all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express as well as three new vulnerabilities. Install now to continue keeping your co...

Exporting Partial Purchase Orders from Microsoft RMS to Quickbooks
When you select to export a Quickbooks file in RMS- in SOM Post Closed Batches- it allows you to check a box that states- Include Purchase Orders. I have tested this and I can see that Purchase Orders can be imported into Quickbooks Accounting. However, I cant test or verify that Partial Purchase Orders will be sent over as well. Has anyone tested this? Can anyone verify if Partial Purchase Orders can be sent to Quickbooks via the closing of the batch? Thanks...Andrea No, Partial POs are not posted to QB. Only completed/closed POs. This is at least part of the reason that RMS will ...

Validating Xml Fragments .NET 2.0
I was wondering if someone would help me with validating specific parts of an xml document again its XSD. I would like to valiate the a fragment <property name="TextMode">Multiline</property> The error I get when validating with validate method of XmlDocument is Validation Error: The 'http://www.w3schools.com:property' element is not declared. Here's the code, Dim ReaderSettings As XmlReaderSettings Dim NameSpaceMgr As XmlNamespaceManager Dim ParserContext As XmlParserContext Dim XmlString As String = "<propert...

Payables Checks Printing with Different Font and Alignment
Hello All, A user just had a new local printer installed on her desktop. When she prints checks the font has changed and the vertical alignment is now off. I plan on trying other print drivers for the printer (PCL6, PS) but figured I'd check out here to see if anyone else has come across this issue. The default top/bottom stub report for checks is being used. No modifications have been made. Thanks for any assistance... Brian Hello Everyone, It ended up being the printer driver that was installed. I changed it to PCL6, which she was using on her older printer, and everything...

Look at this important patch
--rxuqdxeksfvfxxmu Content-Type: multipart/related; boundary="pgeknhwbh"; type="multipart/alternative" --pgeknhwbh Content-Type: multipart/alternative; boundary="fxlenprsrzfd" --fxlenprsrzfd Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Microsoft Client this is the latest version of security update, the "November 2003, Cumulative Patch" update which resolves all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express. Install now to protect your computer from these vulnerabilities, the ...

3 Different Errors from same NG
Just started doing this about a week ago: 3 different error messg. on "ANY" NG I attempt to post to. My ISP says "Igot NO idea. any direction would be grea Outlook Express could not post your message. Subject 'test', Account: 'gamenews.vr1.com', Server: 'gamenews.vr1.com', Protocol: NNTP, Server Response: '440 Posting not allowed', Port: 119, Secure(SSL): No, Server Error: 440, Error Number: 0x800CCCA Outlook Express could not post your message. Subject 'Test', Account: 'news.charter.net', Server: 'news.charter.net', Pr...

different column width
Hi, I need to create a report with 4 columns, where the first column (with labels) to be 4,5cm and the other 3 to be 4cm. Is there a way to do that? On page setup under the "columns" there is no such an option Thanks Christina Christina wrote: >I need to create a report with 4 columns, where the first column (with >labels) to be 4,5cm and the other 3 to be 4cm. > >Is there a way to do that? >On page setup under the "columns" there is no such an option I have not been able to find a way to have two different column widths. I doubt that it will help ...

DOM Reference XML Visual C++6 / MFC
Hello, I search a good and easy example for XML. Where can I find this. I will only for step 1 read and write this XML file. <PARAMS> <TEXT>TestProjekt</TEXT> <COLOR> <RED>234</RED> <GREEN>111</GREEN> <BLUE>33</BLUE> </COLOR> <FONT> <FONT_FILENAME>Arial.ttf</FONT_FILENAME> <SIZE>12</SIZE> </FONT> </PARAMS> #define ISchemaIdentityConstraint_get_name(This,name) \ (This)->lpVtbl -> get_name(This,name) #if defined(__cplusplus) && !defined(CINTERFACE) MIDL_INTERFAC...

Installation of customer Microsoft CRM 3.0 for Outlook
Hi,I have a machine which belongs to the same domain that server CRM3.0, I reached with the session administrator, I launched the installation of customer Microsoft CRM 3.0 for Outlook an error message posts myself: "the user who carries out the program of installation does not belong to the domain" in spite of as I have say I reached with the administrator. Thanck You. Hi, Did you logon to the local workstation as a local administrator? Or did you logon to the domain? (When logging on you are able to select the domain from the drop-down list). Best regards, Merijn van Mou...

Send email from different user.
Does anyone know if it is possible to configure the email so that I can send an email from different CRM user while I am logged in as myself in CRM (make it look like it's coming from another user like I can can do in outlook) If you use Direct E-mail (Actions > Direct E-mail), with an E-mail template, you can do this. >-----Original Message----- >Does anyone know if it is possible to configure the email so that I can send >an email from different CRM user while I am logged in as myself in CRM (make >it look like it's coming from another user like I can can do in...

Help! Character Encoding Problem when exporting from Access to XML
I export a Access table as a txt file every week to a third party provider who distributes the file in XML form to online clients. Recently characters have started to not translate onto sites; usually quotes and apostrophes. I have been told by the third party service that this is due to a problem from cutting-and-pasting btw Excel, Word and Access. How can I 'clean' this data in Access so it is uniform? On May 11, 5:31=A0am, Mark H <Ma...@discussions.microsoft.com> wrote: > I export a Access table as a txt file every week to a third party provide= r > who ...

programatically adding attribute xsi:nil=true to XML element
Hi, I want to add the xsi:nil="true' attribute to an element in XML. I am using XmlNode.Attributes.Append() but the generated output results in the attribute [nil="true"] ignoring the "xsi:" prefix. How do I work around this problem?. Nabeel Moeen wrote: > I want to add the xsi:nil="true' attribute to an element in XML. I am using > XmlNode.Attributes.Append() but the generated output results in the attribute > [nil="true"] ignoring the "xsi:" prefix. It works like this, using CreateAttribute and SetAttributeNode: ...

Different calendar sync counts on 2 clients
I'm synchronizing Entourage with Exchange 2003. When looking at "all events" on one computer, I see ~200 fewer entries than when looking at the same thing on another computer. Both are synchronizing to the same place. Why the difference and how can I figure out what I'm missing on one of them? Mike ...