Home | Back to the J2ME Companion Site
Parsing XML with J2ME

You might at some point have a need to parse XML as part of your J2ME application. Due to the constraints of J2ME, you're going to need a small parser. There are currently three choices, NanoXML, TinyXML, and kXML. All are open source, but NanoXML has the least restrictive license.

For NanoXML and TinyXML, note that you need to download specially-modified versions of the parsers to get them to work with the KVM/CLDC, because the original versions reference classes that aren't defined by the CLDC specification. I ported NanoXML's XMLElement.java file to the CLDC and called it kXMLElement.java. The port was done mostly by simulating some of the missing J2SE classes using inner classes. You'll need to download the full version of NanoXML to use this class. For a modified version of TinyXML, see the TinyXML page on the KVMWorld archive site.

Unlike the other two, kXML is written specifically for the CLDC.

Home | Back to the J2ME Companion Site

Copyright ©2000-2001 by Eric Giguère. This page was last modified on November 1