Permalink
Browse files

Issue #75 - Android support

Android does not implement the (mandatory) XMLSchema (XSD) specification. This is 'broken', and it throws IllegalArgumentException.
This fix catches the IllegalArgumentException which means that the XMLReaders enum is able to initialize. (without this fix, the entire enum crashes, and any external references throw ClassNotFoundErrors in Android).
  • Loading branch information...
1 parent 82e1781 commit df606e1c63dfd5900b4b17e6b1e39824d06ab1ca @rolfl rolfl committed Apr 19, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 core/src/java/org/jdom2/input/sax/XMLReaders.java
View
4 core/src/java/org/jdom2/input/sax/XMLReaders.java
@@ -124,6 +124,10 @@ private XMLReaders(int validate) {
} catch (SAXException se) {
// we could not get a validating system, set the fac to null
fac = null;
+ } catch (IllegalArgumentException iae) {
+ // 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;
}
break;
}

0 comments on commit df606e1

Please sign in to comment.