ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Easily compare two XML files
Date Tue, 20 Aug 2002 11:53:53 GMT
First of all: I have the following links for you:

current JAXP, DOM, SAX javadoc

XML Signature, XML canonicalization, and respective Java APIs

My thoughts concerning XML document comparisons are	as follows:
The W3 consortium has developed a specification called XML Signature.
It deals with signing XML documents. As a prerequesite of being able to sign
a document, one must first develop a valid notion of comparing XML documents.

At first sight, your proposal seems to be quite logical. As you said, it does not
make sense to compare XML documents on byte level. What I want to contribute to your
thoughts is that comparing XML documents seems to be a non trivial thing per se.
Note, that the plan to just compare the element and attribute content is also an oversimplification.
For example: an element's attributes can appear in any order. Therefore, to compare to XML
logically, you first have to canonicalize them. The attributes have to be sorted alphanumerically

The DOM API has method for canonicalization, but I suppose that they mainly merge text nodes

Therefore I would in any case recommend to first read about the w3c insights about document
That might save you some headaches.

Of course, since an standard API for XML Signatures is currently in developement at Sun, as
Java Specification Request 105, you could also consider to wait on this API and then just
this API to compute the signatures of two XML docs you would like to compare and then just
compare the
two signature values.

I hope this was helpful to you. 
(By the way, I am no Ant developer. So don't take my words for granted. ;) ) 

Sascha Coenen

Nette Leute zum Flirten, Lachen und Verlieben,
fuer Reisen, Sport und Freizeit!
View raw message