Re: Comparing two XML files using JDOM

Tatu Saloranta <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <[email protected]>
...
> But it'll be quite expensive or?
> Doing this over SAX tastes more reasonable to me.
>

Given one has to compare 2 input sources
simultaneously, using SAX gets much trickier. So for
this particular use case, Stax API seems more optimal.

However, it's still not entirely clear as to what
exactly is meant with equality: how strict is it? Is
it logical or physical equality (do different
namespace prefixes matter? Ordering of attributes?
Ignorable white space? Use of CDATA vs. characters
segment?)

I personally like using Canonical XML for comparisons,
which is geared more towards logical equality. XOM
implements this nicely for what that's worth.

-+ Tatu +-



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.