[jdom-interest] Attribute comparison

Jason Hunter jhunter at collab.net
Tue Dec 5 11:35:15 PST 2000

> I mean that if for internationalization reasons you'd like to 
> change all comments to other ones (some kind of find/replace 
> mechanism) - it's much easier to do so if all comments that has 
> the same value are replaced in one call.

So you want a little loop that says "if this comment equals this
comment, then change it..."?  You could still do such a thing, just
write your own comparison logic. 
comment1.getText().equals(comment2.getText()) should do it for this
simple case.  For elements you could write your own cutsom logic that
compared local names, name and namespace, name/namespace/namespacemap,
or whatever.

> But as I said, it's a fair decision and I can live with that ;-)

Cool.  :-)


More information about the jdom-interest mailing list