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 Eva Flora <ev...@bluemartini.com> on 2001/03/09 02:11:11 UTC

Parser validation question

Is there anything else I need to do to turn validation on?

I get the error:
    org.xml.sax.SAXNotRecognizedException: Feature:
http://xml.org/sax/features/vali
dation
    at
org.apache.xerces.jaxp.SAXParserFactoryImpl.setFeature(SAXParserFacto
ryImpl.java:100)
        at com.bluemartini.test.xml.test.main(test.java:34)
SAXException error

If I remove line 26:

saxFactory.setFeature("http://xml.org/sax/features/validation",true);
validation does not seem to work i.e. my attached test case runs fine
when it parses
an invalid document.

I am using xerces -1_3_0.

Thanks in advance,
Eva



Re: Parser validation question

Posted by Gary L Peskin <ga...@firstech.com>.
Eva Flora wrote:
> 
> Is there anything else I need to do to turn validation on?
> 
> I get the error:
>     org.xml.sax.SAXNotRecognizedException: Feature:
> http://xml.org/sax/features/vali
> dation
>     at
> org.apache.xerces.jaxp.SAXParserFactoryImpl.setFeature(SAXParserFacto
> ryImpl.java:100)
>         at com.bluemartini.test.xml.test.main(test.java:34)
> SAXException error
> 
> If I remove line 26:
> 
> saxFactory.setFeature("http://xml.org/sax/features/validation",true);
> validation does not seem to work i.e. my attached test case runs fine
> when it parses
> an invalid document.
> ...

Eva --

You need to set this feature on the parser, not the saxFactory.

HTH,
Gary

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