Skip to content

Commit

Permalink
Issue #75 - Android support
Browse files Browse the repository at this point in the history
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
rolfl committed Apr 19, 2012
1 parent 82e1781 commit df606e1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/src/java/org/jdom2/input/sax/XMLReaders.java
Expand Up @@ -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;
}
Expand Down

0 comments on commit df606e1

Please sign in to comment.