[jdom-interest] deep equals

Bradley S. Huffman hip at cs.okstate.edu
Sat Oct 16 10:28:52 PDT 2004

Elliotte Harold writes:

> The problem with deep equals of course is that there are many different 
> definitions depending on need. For instance:
> 1. Do you consider namespace prefixes?
> 2. Do you consider namespaces in scope?
> 3. Do you consider xml:lang and xml:space positions?
> 4. Do you consider base URIs, and just how do you handle xml:base
> 5. Do you normalize text in Unicode fashion before comparing?
> 6. Do you combine adjacent text nodes.
> Depending on context, you could go either way on any of these questions. 
> It's not clear that any one definition really satisfies all needs.

But if you allow for extension, having all comparisons as separate, over-ridable
methods, then most applications can tweak to meet their particular needs.


More information about the jdom-interest mailing list