[jdom-interest] detach() [eg]

Scott Means smeans at moonlightideas.com
Sun Apr 22 19:48:43 PDT 2001


It seems to me that one of Jason's major objections is the need to catch a
random new exception anytime he wants to use the .detach() method, e.g.:

> >} catch (IllegalXXXException e) {

The true meaning of this exception is: "You've tried to violate XML
well-formedness." So maybe it would be a good time to think about a
general-purpose WellFormednessException that could be thrown for anything
that would break the document. Unfortunately, it looks like there are
already a number of Illegal???Exceptions that would fall under this
umbrella, so I guess it's too late. But it seems like it would be
convenient (and not too icky for the programmer) to just catch a single
WellFormednessException for any of these violations and sort through the
exception message. And on that tack, when it comes time to worry about
in-memory validity, you could have a ValidityException to go with it.


=======================================
Scott Means (smeans at moonlightideas.com)





More information about the jdom-interest mailing list