Skip to content

Handle UnsupportedOperationException when creating XSDVALIDATING. #94

Merged
merged 1 commit into from Sep 27, 2012
View
6 core/src/java/org/jdom2/input/sax/XMLReaders.java
@@ -128,6 +128,12 @@ private XMLReaders(int validate) {
// this system does not support XSD Validation.... which is true for android!
// we could not get a validating system, set the fac to null
fac = null;
+ } catch (UnsupportedOperationException uoe) {
+ // SAXParserFactory throws this exception when setSchema is called.
+ // Therefore every factory throws this exception unless it overrides
+ // setSchema. A popular example is Apache Xerces SAXParserFactoryImpl
+ // before version 2.7.0.
+ fac = null;
}
break;
}
Something went wrong with that request. Please try again.