My line 417 is cerr << "An error occurred during parsing\n Message:
"....I assume that is not where I am supposed to plug it in.
Ok, so the DOMPrint example uses both:
DOMTreeErrorReporter *errReporter = new DOMTreeErrorReporter();
parser->setErrorHandler(errReporter);
and
DOMErrorHandler *myErrorHandler = new DOMPrintErrorHandler();
theSerializer->setErrorHandler(myErrorHandler);
I think what you are saying is that these types of errors (schema
validation, etc) will be handled by the error handler that is plugged into
the parser? Which means that the DOMErrorHandler would handle the errors
if I used
DOMErrorHandler *myErrorHandler = new DOMPrintErrorHandler();
parser->setErrorHandler(myErrorHandler );
If that is true, then what is the point of the section of the DOMPrint
example where the DOMErrorHandler is plugged into theSerializer?
Thanks for your help again!!!!
Gareth Reakes
<[EMAIL PROTECTED] To: [EMAIL PROTECTED]
oft.com> cc:
Subject: Re: Question about
DOMErrorHandler
03/05/2003 10:44
AM
Please respond to
xerces-c-dev
Hi,
I think I see where the problem is. You are setting the error
handler for the serializer, not the parser. Take a look at line 417. That
is where you should plug it it.
Gareth
On Wed, 5 Mar 2003 [EMAIL PROTECTED] wrote:
>
> Thanks for the response!
>
> Yes, I have done said binding in my code, but it is probably easier to
deal
> with the DOMPrint example.
>
> // plug in user's own error handler
> DOMErrorHandler *myErrorHandler = new DOMPrintErrorHandler();
> theSerializer->setErrorHandler(myErrorHandler);
>
> Now, when I run that with personal-schema.xml (the included example),
> everything runs fine. However, if I change part of the file to be
> something that is well-formed, but not valid against the schema such as:
>
> <person2 id="Big.Boss" >
> <name><family>Boss</family> <given>Big</given></name>
> <email>[EMAIL PROTECTED]</email>
> <link subordinates="one.worker two.worker three.worker four.worker
> five.worker"/>
> </person2>
>
> The error goes through the DOMTreeErrorReporter::error function instead
of
> the DOMErrorHandler *myErrorHandler = new DOMPrintErrorHandler();
>
> I thought these types of operational errors were supposed to go through
the
> DOMErrorHandler. If they don't, then exactly what might I ever use the
> DOMErrorHandler for?
>
> Thanks!
>
>
>
> Gareth Reakes
> <[EMAIL PROTECTED] To:
[EMAIL PROTECTED]
> oft.com> cc:
> Subject: Re: Question
about DOMErrorHandler
> 03/05/2003 02:37
> AM
> Please respond to
> xerces-c-dev
>
>
>
>
>
>
> Hi,
> Are you binding your error handler with the parser? IN
> DOMPrint
> this is where it happens:
>
>
> DOMTreeErrorReporter *errReporter = new DOMTreeErrorReporter();
> parser->setErrorHandler(errReporter);
>
> If you create you own you must tell the parser to use it. If this is not
> the problem then post a section of your code and well take a look.
>
> Gareth
>
> On Tue, 4 Mar 2003 [EMAIL PROTECTED] wrote:
>
> > I have not been able to get the DOMErrorHandler interface to return any
> > information. Even while using the DOMPrint example with the schema and
> > intentionally submitting non-valid code, the error is always returned
> > through the DOMTreeErrorReporter (ErrorHandler).
> >
> > I thought the DOMErrorHandler was supposed to get called to report
errors
> > that happen while processing XML data. Is validating a document not
such
> > an operation?
> >
> > Any help would be greatly appreciated.
> >
> > Thanks,
> > Elliot Rapp
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> --
> Gareth Reakes, Head of Product Development +44-1865-203192
> DecisionSoft Limited http://www.decisionsoft.com
> XML Development and Services
>
>
>
>
> ---------------------------------------------------------------------
> 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]
>
>
--
Gareth Reakes, Head of Product Development +44-1865-203192
DecisionSoft Limited http://www.decisionsoft.com
XML Development and Services
---------------------------------------------------------------------
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]