功能'http://apache.org/xml/features/standard-uri-conformant'的SAXNotRecognizedException

Dar*_*Var 2 java xml jaxb saxparser

任何人都知道为什么我在下面的代码中遇到异常.我正在使用Java 6.

final XMLReader reader = XMLReaderFactory.createXMLReader();
reader.setFeature("http://xml.org/sax/features/validation", doValidate);
reader.setFeature("http://apache.org/xml/features/validation/schema", doValidate);
reader.setFeature("http://apache.org/xml/features/standard-uri-conformant", doValidate);


org.xml.sax.SAXNotRecognizedException: Feature 'http://apache.org/xml/features/standard-uri-conformant' is not recognized
Run Code Online (Sandbox Code Playgroud)

Dar*_*Var 5

找到解决方案

将xercesImpl 2.9.1添加到我的类路径中,而不是使用内部Java 6捆绑版本的Xerces.