SSP
Status
I no longer use (or maintain) this parser. It was written in first year when I had much less knowledge of parsing simple grammars than I do now, so it is theoretically inelegant. It does still work, though. :-)
Motivation
I needed an XML parser. Xerces was bloated, and buffered the data. The
documentation for a workaround was incorrect. NanoXML reads the entire document, and then fires SAX events. Hexml didn't make a whole lot of sense to me. So I wrote my own parser.
Intentions
My ideal parser does DTD loading and document validation, simple entity substitution, default attribute value insertion (Based on the DTD), and is fairly fast with low overhead. I am writing a client/server chat system that uses xml to communicate between the client and the server. This means that the amount of code that needs to be transfered to the client (in the form of an applet jar file) needs to be minimized, and the amount of overhead for each connection on the server end also needs to be minimixed.
I will also want a simple document serializer, that takes SAX events and turns them into text to send across, to be re-converted to SAX events.
I have no interest in namespace handling, or any of the other really wonky
features of xml, and thus they won't be included in SSP.
SSP is under the GNU
GPL.
Download
You can get both files or the parser as a single file.
The parser depends
on the org.xml.sax and
org.xml.sax.helpers SAX packages. These packages are in the
public domain, and can be downloaded
here.
There is also documentation
for those two packages. Most of SSP is JavaDoc'd, but I haven't bothered
to actually generate the documentation at this point. There is a Simple DocumentHandler that just
does some output for each event type. The XMLParser.java has a commented
out main(String[]) method that acts as a simple test, either loading a sample xml file or reading data from a socket on port
12000, using SimpleHandler.java.
Versions