|
Embedded Java and XML |
||
|
The Wilson Partnership has been actively involved with Java and XML technologies since their introduction. In early 1999 we began to develop Java software for low cost embedded systems. We rapidly discovered that writing Java code for platforms with limited processing power and memory required a high degree of discipline if the software was to operate effectively. We spent quite some time looking for an XML parser which would run on small embedded systems (systems with ~512Kb of RAM) and which would leave room for a substantial application (the prime purpose of embedded systems is generally not to parse XML documents!). Whist we could find several XML parsers which had reasonably small code footprints they all consumed an unacceptably large amount of data space when running. These parsers are admirably suited to use in applets but are not a practical proposition on our platforms. We are particularly interested in using XML as a configuration file format and in supporting XML-RPC (and, possibly SOAP at a later date). We decided to produce our own XML parser which was more suited to our purpose. John Wilson wrote the first version of MinML (a minimal XML parser) in a day. This code was refined and extended over a period of three months. We now have a robust parser for a useful subset of XML which takes less than 8Kb of code space on an embedded system and can parse substantial XML documents using less than 64Kb of heap space. MinML supports the SAX1 interface which means that it can be used a large range of existing Java programs. We have added a minor extension to the SAX1 interface (by subclassing org.xml.sax.DocumentHandler and org.xml.sax.Parser) which allows MinML aware programs to minimise the storage costs of processing the character data in a an XML document. We have made MinML available for free download under a BSD style licence here. We have used MinML as a component of MinML-RPC. This is an implementation of XML-RPC (initially, a server only implementation) for small embedded systems. MinML-RPC takes less than 18Kb of code space (including the XML parser) and typically uses less than 64Kb of heap space to execute a single procedure call. We have made MinML-RPC available for free download under a BSD style licence here. Out latest effort has been to produce a version of MinML which is namespace aware and which implements the SAX2.0 interface. This makes the program larger (by about 2.5Kb). We call this variant MinML2. We have made MinML2 available for free download under a BSD style licence here.
|