[jdom-interest] NoSuch*Exceptions in JDOM

philip.nelson at omniresources.com philip.nelson at omniresources.com
Mon Jul 10 11:43:00 PDT 2000

> Since 1 in 10 throwing an exception is pretty low in the real world
> ("real world" XML probably has optional attributes and/or elements
> more often than that), your saying that "only about 150% as long" is
> pretty scary. If you have a server application that is processing XML
> at a high rate, that amounts to a lot of overhead.
>  If JDOM
> claims to aim for "making 80% of common tasks easy", but then forces
> the programmer to resort to workarounds and hacks in order to perform
> *basic* functions, then something does not add up.

Optional attributes and elements are legitimate parts of XML documents so I
think that *forcing* an exception where they occur is the wrong thing to do
and will incur a performance hit.  Required elements are also specified by a
DTD and should throw an exception if not found IMHO.  I think the api should
support both use cases.  We don't have a way to use a DTD to enforce
optional vs required attributes and elements but I think it would be great
if the api at least allowed these to be expressed.

I'm going to sit back and listen again, this has been a fascinating
discussion!  My only answer to this question in other apps has been similar
to this one, "it depends".

More information about the jdom-interest mailing list