MIDP XML Parser Roundup

Team-Fly

Table 11-1 lists small XML parsers that can be used with the MIDP platform. Each parser will be explored in subsequent sections, but the table here gives you a quick way of comparing parsers. Each of these parsers is released under some type of open-source software license as listed in the License column. The Size column shows the approximate size of the compressed class files for the parser. The Type column describes the parsing paradigm using one of the following:

  • "Pull" indicates that the programmer repeatedly calls a method on the parser to propel it through a document.

  • "Push" means that the parser runs through the entire document by itself, invoking callback methods in your code when important events happen. SAX parsers implement the push paradigm.

  • "Model" indicates that the parser builds some internal representation (in memory) of the document. After parsing is finished, your code can examine this model and pull out element data.

    Table 11-1: Small XML Parsers

    NAME

    URL

    LICENSE

    SIZE

    MIDP

    TYPE

    SAX

    kXML

    http://kxml.enhydra.org/

    EPL

    34KB

    yes

    pull

    no

    MinML

    http://www.wilson.co.uk/xml/minml.htm

    BSD

    13KB

    no

    push

    1.0

    NanoXML

    http://nanoxml.sourceforge.net/

    zlib/libpng

    10KB

    patch

    model

    1.0 optional

    TinyXML

    http://www.gibaradunn.srac.org/tiny/

    GPL

    13KB

    no

    model

    no

    wbxml

    http://www.trantor.de/wbxml/

    GPL

    19KB

    no

    push

    1.0

The MIDP column indicates whether or not the parser source code compiles without modification on the MIDP platform. Finally, the SAX column tells what version of SAX the parser supports.

Table 11-2 provides more information about each type of license, listing both the license name and a URL that provides more information.

Table 11-2: Software Licenses

NAME

URL

EPL

http://kxml.enhydra.org/software/license/

BSD

http://www.opensource.org/licenses/bsd-license.html

zlib/libpng

http://www.opensource.org/licenses/zlib-license.html

GPL

http://www.gibaradunn.srac.org/tiny/gpl.txt

In the following sections, I'll describe each parser. I'll explain how to make the parser compile for MIDP, as well as how each parser can be used from a MIDlet.


Team-Fly


Wireless Java. Developing with J2ME
ColdFusion MX Professional Projects
ISBN: 1590590775
EAN: 2147483647
Year: 2000
Pages: 129

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net