ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@freenet.de
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
	http://java.sun.com/xml/jaxp/index.html

XML Signature, XML canonicalization, and respective Java APIs

	http://www.jcp.org/jsr/detail/105.jsp
	http://www.w3.org/2000/09/xmldsig#
	http://www.w3.org/Signature

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
documents
logically, you first have to canonicalize them. The attributes have to be sorted alphanumerically
etc.

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

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

Of course, since an standard API for XML Signatures is currently in developement at Sun, as
the
Java Specification Request 105, you could also consider to wait on this API and then just
use
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. ;) ) 

greetings
Sascha Coenen



--
Nette Leute zum Flirten, Lachen und Verlieben,
fuer Reisen, Sport und Freizeit!
http://www.freenet.de/tipp/single
Mime
View raw message