[jdom-interest] ValidityException
Elliotte Rusty Harold
elharo at metalab.unc.edu
Tue Jun 17 13:01:45 PDT 2003
At 12:36 PM -0700 6/17/03, Jason Hunter wrote:
>Second thing is, I'm unclear on the purpose for the public class
>SAXValidityException. Couldn't it be package protected? It's
>confusing especially since SAXValidityException doesn't extend
>ValidityException.
Absolutely. This is just because I have to throw some kind of
SAXException due to the method signature (or perhaps a
RuntimeException). It doesn't need to be public.
>Third, can you be sure in BuilderErrorHandler that an error()
>callback means a validation error?
No, you can't. For instance Crimson also reports namespace errors by
calling error. However, in most parsers the most common error() calls
are all validity errors.
>Lastly, the build() call will only throw a ValidityException if our
>standard BuilderErrorHandler is installed. If they install their
>own, it won't happen anymore. That seems like an unfortunate side
>effect.
Yes. This is a really an atrocious hack. We could hack further and
always use our own ErrorHandler, with the option to chain ours to
theirs if they install one. This is all really, really messy. I don't
see a clean way to do any of this. If you or anyone else can think of
a nicer way to do any of this, it would be much appreciated.
--
Elliotte Rusty Harold
elharo at metalab.unc.edu
Processing XML with Java (Addison-Wesley, 2002)
http://www.cafeconleche.org/books/xmljava
http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA
More information about the jdom-interest
mailing list