站内搜索: 请输入搜索关键词
当前页面: 图书首页 > Wireless Java Developing with J2ME, Second Edition

MIDP XML Parser Roundup - Wireless Java Developing with J2ME, Second Edition

Previous Section Next Section

MIDP XML Parser Roundup

Table 14-1 lists small, open-source XML parsers that can be used with the MIDP platform. 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 14-1: Small XML Parsers

NAME

VERSION

URL

LICENSE

SIZE

MIDP

TYPE

kXML

1.21

http://kxml.enhydra.org/

EPL

21KB

Yes

Pull

kXML

2.1.6

http://kxml.org/

CPL

9KB

Yes

Pull

MinML

1.7

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

BSD

14KB

No

Push

NanoXML

2.2.2 lite

http://web.wanadoo.be/cyberelf/nanoxml/

zlib/libpng

6KB

No

Model

TAM

-

http://simonstl.com/projects/tam/

MPL

17KB

Yes

Push

TinyXML

0.7

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

GPL

6KB

No

Model

XmlReader

-

http://kobjects.org/utils4me/

LGPL

5KB

Yes

Pull

XMLtp

1.7

http://mitglied.lycos.de/xmltp/

BSD

21KB

No

Model

Xparse-J

1.1

http://www.webreference.com/xml/tools/xparse-j.html

GPL

7KB

Yes

Model

The MIDP column indicates whether or not the parser source code compiles without modification on the MIDP platform.

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

Table 14-2: Software Licenses

NAME

URL

BSD

http://opensource.org/licenses/bsd-license.php

CPL

http://opensource.org/licenses/cpl.php

EPL

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

GPL

http://www.webreference.com/xml/tools/license.html

LGPL

http://opensource.org/licenses/lgpl-license.php

MPL

http://www.mozilla.org/MPL/MPL-1.1.html

zlib/libpng

http://opensource.org/licenses/zlib-license.php

In the following sections, I'll describe one of the more solid parsers, kXML 1.21. I'll also talk about techniques for porting the parsers that don't comply with MIDP.


Previous Section Next Section