You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Luke Blanshard <lu...@quiq.com> on 2001/01/02 17:26:17 UTC

Re: Validation with SAX

Well, I have no idea what the JAXP interface looks like, but I can't believe
you can call setValidating AFTER you create the parser and still expect the
parser to validate!

Luke

Scott Carter wrote:

> I have a simple question that I hope someone can answer.  I'm trying to do a
> validating parse of a series of documents using SAX, but the problem I'm
> having is that the parser doesn't appear to be validating.  I'm using JAXP
> to call the parser and I'm setting the validate option as follows:
>
>                 RequestHandler handler = new RequestHandler();
>                 SAXParser saxParser = factory.newSAXParser();
>                 factory.setValidating(true);
>                 saxParser.parse(docStream, handler);
>
> Any ideas why this is happening?


RE: Validation with SAX

Posted by Scott Carter <sc...@dotsconnect.com>.
Actually, it was validating properly, I was not properly handling the
resulting errors.  Under SAX, since it is event based, errors that are not
handled and specifically thrown, using the HandlerBase.error() method are
ignored rather than being thrown back  thanks for your help.

Scott

-----Original Message-----
From: Luke Blanshard [mailto:luke@quiq.com]
Sent: Tuesday, January 02, 2001 11:26 AM
To: xerces-j-dev@xml.apache.org
Subject: Re: Validation with SAX


Well, I have no idea what the JAXP interface looks like, but I can't believe
you can call setValidating AFTER you create the parser and still expect the
parser to validate!

Luke

Scott Carter wrote:

> I have a simple question that I hope someone can answer.  I'm trying to do
a
> validating parse of a series of documents using SAX, but the problem I'm
> having is that the parser doesn't appear to be validating.  I'm using JAXP
> to call the parser and I'm setting the validate option as follows:
>
>                 RequestHandler handler = new RequestHandler();
>                 SAXParser saxParser = factory.newSAXParser();
>                 factory.setValidating(true);
>                 saxParser.parse(docStream, handler);
>
> Any ideas why this is happening?


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org