Comparing DOM trees 2003-01-29 - By Christian Geuer-Pollmann
--On Dienstag, 28. Januar 2003 22:44 -0500 mdumontier1797 <mdumontier1797@(protected)> wrote:
> I'm trying to find out the best way to compare 2 DOM trees. Do i have to > just walk the tree the do the comparison myself or is there an > easier/better way. I'm mostly interested in a structural comparison then > a textual one. any help on this matter would be appreciated.
You can canonicalize both subtrees and do an octet-wise comparison (using the Canonicalizers from the XML-Security project). But this includes that whitespace is significant, therefore a textual comparison.
If you say that you want a "structural" comparison, there is no definition of what this is, so you have to invent your own metric for that.
Christian
--------------------------------------------------------------------- To unsubscribe, e-mail: xerces-j-user-unsubscribe@(protected) For additional commands, e-mail: xerces-j-user-help@(protected)
|
|