[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

AW: how can I compare two xml files ?

Subject: AW: how can I compare two xml files ?
From: "Mengel Andre (FV/SLM) *" <Andre.Mengel@xxxxxxxxxxxx>
Date: Thu, 19 Apr 2001 10:36:05 +0200
compare two xml document

> -----Ursprüngliche Nachricht-----
> Von: Richard Light [mailto:richard@xxxxxxxxxxxxxxxxx]
> Gesendet: Mittwoch, 18. April 2001 16:41
> An: Mengel Andre (FV/SLM) *
> Betreff: Re:  how can I compare two xml files ?
> 
> 
> In message 
> <55CB9FEAE87DD411A83200508BDF0DFE06D176@xxxxxxxxxxxxxxxxxxx>,
> Mengel Andre (FV/SLM) * <Andre.Mengel@xxxxxxxxxxxx> writes
> 
> >I want to compare two XML-files in order to test if they have 
> >the same content. Is it possible to use XSLT in order to solve this
> >(I am not an XSLT-Expert) problem ? What I have in mind is 
> to transform
> >both XML-files by using an XSL-sheet. Then after processing I want to
> >compare 
> >both transformed files byte for byte.
> >So the transformation would have to rearrange the attributes 
> in a unique
> >manner.
> >The structure of the xml-files I want to compare is very complex.
> >Does that imply that the XSL-file will also be very complex 
> , or is it 
> >possible to use a kind of standard-transformation without any details
> >about the xml-files themselves ?
> 
> André,
> 
> I have tackled this problem in a slightly different way.  I iterate
> through the two files, comparing them as I go.  The result is a third
> XML document which lists the differences between the two files, in a
> form which I hope can be used to reproduce the earlier version of a
> document from its current form and this 'differences' document.
> 
> The style sheet is attached, in the hope that it might be a starting
> point for your own work.
> 
> Richard Light.
> 

Hello Richard,

thank you for your fast reply refering to my question.
If I have understood you, then two xml-files would be the
same if the third file generated with your stylesheet would be
an empty file (Because no differences could be found).
Would this file also be empty if the attributes of two documents
have different orders ?
What happens if two documents are the same, but one of them 
contains ignorable whitespace ?
Excuse me for this questions but at the moment I don't have
the software to try it out myself.
I also contacted this mailing-group in order to find out if there
is a more convenient way to solve my original question.
Because another way would be to write a program that converts
the two XML-Documents to a kind of canonical form and then compare
each file byte for byte.

Best regards


André Mengel












 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.