[jdom-interest] ValidityException
Jason Hunter
jhunter at servlets.com
Tue Jun 17 19:21:03 PDT 2003
I'm thinking we should punt on this change unless we can more reliably
report validity errors. From what you're saying, SAX itself doesn't
reliably tell you when there's a validity error. Thus it'll be pretty
hard to have JDOM deliver this information. I don't want to see
ValidityException have false positives or false negatives.
-jh-
Elliotte Rusty Harold wrote:
> 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.
More information about the jdom-interest
mailing list