The reason for this is that the parser can be put into a 'go as far as you
can' mode. If errors were reported by throwing an exception, you could never
report more than one, because throwing unwinds the stack.

--------------------------
Dean Roddey
The Charmed Quark Controller
Charmed Quark Software
[EMAIL PROTECTED]
http://www.charmedquark.com

"If it don't have a control port, don't buy it!"


----- Original Message -----
From: "Jole Jonikic" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 24, 2002 7:37 AM
Subject: Re: validating against DTD (SAXParser)


> I found the problem myself.
>
> I thought I would get an exception in the main program if validation was
> negative and thereby getting an error message, however it showed up not to
> work that way. Since I hadn't overriden the methods in the error handler I
> didn't get any error message showing me that something was wrong. My
> solution was to override the methods error, fatalError and warning for the
> errorhandler and take care of the errors and warnings there - i.e. output
> error messages.
>
> cheers
>
> .jole
>
>
>
> 02-01-24 11.33, skrev Jole Jonikic p� [EMAIL PROTECTED] f�ljande:
>
> > Hi everyone,
> >
> > My simple question is: how can I let the SAXParser do a validation
against
> > the DTD that I have stated at the beginning of the XML-file.
> >
> > I have the following line in the XML-file:
> > <!DOCTYPE adc:adConnexion SYSTEM "IFRAadConnexion1_0.dtd">
> >
> > When running the sample SAXCount it gets validated but when trying to do
the
> > same in my own program it doesn't bother checking validity against the
> > dtd-file.
> >
> > Shouldn't the following lines be enough???:
> > parser->setDoValidation (true);
> > parser->setDoNamespaces (true);
> >
> > I've attached a DocumentHandler to the parser and overriden the methods
> > startElement, endElement etc., do I need to attach an ErrorHandler and
> > override it's methods as well to make it work? (I tried that too but
can't
> > manage to get the XML validated.)
> >
> > Thanks a lot for any help!
> >
> > Jole
> >
> >
> > PS. I have looked in the FAQ and searched the Mail Archives but been
unable
> > to find an answer.
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to