Jetty vs. gcj

Per Bothner per@bothner.com
Mon Apr 7 19:38:00 GMT 2003


Jeff Sturm wrote:
> - Jetty needs an XML parser.  I used Xerces, in spite of its large size.
> It should be possible to use a smaller SAX-only parser.

The Kawa distribution includes gnu.xml.XMLParser (actually
XMLParser.in, which can be pre-processed to a char or a byte
version).  It doesn't handle DTDs or encoding specifications
(I want to add support for the latter).  However, it is compact,
very efficient (no numbers but it was written to minimize
method calls and object allocation), and is standalone.
It writes the result to ParsedXMLHandler interface, which
is similar to SAX.  The reason for the special-purpose
interface is that SAX hardwires some assumptions that I
wanted to make optional.  There is a bridge from ParsedXMLHandler
to SAX2 ContentHandler, and an sketch of an implementation of
XMLReader (see gnu.kawa.sax), but it is not complete or tuned.
(I don't use SAX myself.  Instead I use a concpetually similar
but less XML-specific Consumer interface.)
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/




More information about the Java mailing list