Hi Ugo,
"Ugo Corda" <ugo@xxxxxxxxxx> wrote on 06/08/2006 08:31:07 PM:
> Actually, I just noticed that validation does occur (I see the error
> messages produced), but what I was expecting was some kind of
> exception to be thrown by "parse". Instead, I only get error
> messages on the console, and the program continues execution as if
> nothing happened.
>
> Is there a way to get an exception to be thrown when the xml
> document does not follow the schema?
Yes. Write an ErrorHandler [1] which throws exceptions and register it
with the parser.
> Thank you,
> Ugo
[1]
http://xerces.apache.org/xerces2-j/javadocs/api/org/xml/sax/ErrorHandler.html
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@xxxxxxxxxx
E-mail: mrglavas@xxxxxxxxxx
|
Try Searching:
servers, voip, java, networking, microsoft ...
|
|
|
|