Java 5: builtin validating Parser not found
Brought to you by:
yuvalo
Under Java 5, for
SAXParserFactory f =
SAXParserFactory.newInstance();
f.setValidating(true);
I get:
javax.xml.parsers.ParserConfigurationException: XML
document validation is not supported
That's because the builtin SAXParserFactory now is
com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
which should be checked for in JAXPSAXParserFactory:
// Try Java 5 built-in
try {
return Class.forName(
"com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl");
}
catch (ClassNotFoundException e) {
}
// Finally try Crimson, Java 1.4 built-in
try {
return Class.forName(
"org.apache.crimson.jaxp.SAXParserFactoryImpl");
}
catch (ClassNotFoundException e) {
return null;
}
Logged In: NO
PS:
That's of course after I fixed all the other related
problems in the same area already listed.
mschulz@dinmar.com