[jdom-interest] Comparing two XML files using JDOM

Tatu Saloranta cowtowncoder at yahoo.com
Tue Mar 18 12:17:04 PDT 2008


...
> 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


More information about the jdom-interest mailing list