[jdom-interest] JDOM and Android

Rolf Lear jdom at tuis.net
Mon Apr 23 16:28:23 PDT 2012


Hi all.

I think I am ready to produce a statement on the 'Status of JDOM on 
Android'...

The full wiki page is here:

https://github.com/hunterhacker/jdom/wiki/JDOM2-and-Android

Here is a summary...

JDOM is fully functional on Android with the following 2 exceptions:

1. Android has neither a StAX API nor an implementation.

As a result, all JDOM input and output classes that source/sink StAX 
streams will fail. This includes all classes with the word 'StAX' in the 
classname. Using these JDOM classes will cause a 'FATAL' application 
error and your JDOM app will 'crash'.

2. JDOM requires third-party support to implement XML Parsing and the 
default parser on Android has limited features, and thus JDOM 
functionality is limited too.

As a result, using the default XML parser you will not be able to do:
- DTD validation (even though the DocType is parsed and used to add 
default attributes, entity references, etc.)
- XMLSchema validation (even though the XSD Schema is parsed and used to 
add default attributes, etc.)
- suppress the expansion of Entity References - &entity; type references 
are always expanded.
- receive 'internal subset' values from the DocType if there are any.

It should be noted that it is possible to install Xerces parser with 
your Android app, but this does not add significant value because 
neither the DocType nor Schema validation is possible with Xerces 
because of various interdependencies within Xerces that make validation 
impossible.

Additionally, the JAXP process in Android is somewhat broken, and as far 
as I can tell it is not possible to install Xerces as the 'default' 
parser, but only as a create-each-instance-by-name SAX2 parser.

Thus, in conclusion, a number of internal issues have been resolved in 
JDOM to make it compatible with Android. JDOM has dependencies though on 
third part functionality (SAX/DOM/StAX) and these dependencies have 
limitations on Android. As a result JDOM has similar limitations.

Of significance, the 'core' functionality of parsing, manipulating, and 
outputting XML though JDOM is all fully functional.

Rolf


More information about the jdom-interest mailing list