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.
|
NAME |
VERSION |
URL |
LICENSE |
SIZE |
MIDP |
TYPE |
|---|---|---|---|---|---|---|
|
kXML |
1.21 |
EPL |
21KB |
Yes |
Pull |
|
|
kXML |
2.1.6 |
CPL |
9KB |
Yes |
Pull |
|
|
MinML |
1.7 |
BSD |
14KB |
No |
Push |
|
|
NanoXML |
2.2.2 lite |
zlib/libpng |
6KB |
No |
Model |
|
|
TAM |
- |
MPL |
17KB |
Yes |
Push |
|
|
TinyXML |
0.7 |
GPL |
6KB |
No |
Model |
|
|
XmlReader |
- |
LGPL |
5KB |
Yes |
Pull |
|
|
XMLtp |
1.7 |
BSD |
21KB |
No |
Model |
|
|
Xparse-J |
1.1 |
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.
|
NAME |
URL |
|---|---|
|
BSD | |
|
CPL | |
|
EPL | |
|
GPL | |
|
LGPL | |
|
MPL | |
|
zlib/libpng |
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.