Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SAXNotRecognizedException with the schemaLanguage property??

51 views
Skip to first unread message

Barry Burd

unread,
Apr 27, 2003, 3:30:16 PM4/27/03
to
I'm getting the following message:

org.xml.sax.SAXNotRecognizedException: Property:
http://java.sun.com/xml/jaxp/pr
operties/schemaLanguage
at org.apache.crimson.parser.XMLReaderImpl.setProperty(XMLReaderImpl.java:266)
at org.apache.crimson.jaxp.SAXParserImpl.setProperty(SAXParserImpl.java:183)
at SAXParserExample.main(SAXParserExample.java:22)

with code that I more or less copied and pasted from
http://java.sun.com/xml/change-requests-11.html. Here's the code:

try {
SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setNamespaceAware(true);
spf.setValidating(true);
SAXParser sp = spf.newSAXParser();
sp.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage",
"http://www.w3.org/2001/XMLSchema");
sp.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource",
"http://www.example.com/Report.xsd");
DefaultHandler dh = new DefaultHandler();
sp.parse("http://www.wombats.com/foo.xml", dh);
} catch(SAXException se) {
se.printStackTrace();
}

Does anyone know why I'm getting this error message? Thanks.

Bienvenido David

unread,
Apr 27, 2003, 8:08:38 PM4/27/03
to
What XML parser are you using? You might be using an XML parser that
doesn't support this feature. Try using Xerces2. This supports JAXP 1.2.
0 new messages