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;
}
Nobody/Anonymous ( nobody ) - 2005-07-10 16:22
5
Open
None
Nobody/Anonymous
Other
None
Public
|
Date: 2005-07-10 22:42 Logged In: NO |
Copyright © 2009 Geeknet, Inc. All rights reserved. Terms of Use