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.