Brains2b.ORG

Saxo 1.10

stable

component

A SAX2 compliant XML parser and writer

Full description

An Parser that is SAX2 compliant, ContentHandler only. This package also implements a writer with the comparable functions to the ContentHandler for conveniance

Altohugh Java 1.4 support its own XMLReader I'm keeping this around while it is a bit faster on smaller files and with 9,5kb it doesn't take much room. Furthermore I still find SAXWriter very helpfull.

Files
namedatezipzip (source)tar.gztar.gz (source)
Saxo 1.1013-07-2007Saxo-1.10.zipSaxo-src-1.10.zipSaxo-1.10.tar.gzSaxo-src-1.10.tar.gz
Saxo 0.2009-01-2006Saxo-0.20.zipSaxo-0.20.tar.gz

Note: If you want to make a quick start download the .zip or .tar.gz file. It includes the compiled jar and possible dependencies. The sources contains the sources for this specific project and the compiled libraries listed as dependencies.

Dependencies

language:

java 1.4+

Using Saxo

How to use

SAXReader

You can use the SAXReader as a normal SAX driver by defining org.xml.sax.driver=org.brains2b.saxo.SAXReader through the system properties. You can also call SAXReader reader = new SAXReader() directly

SAXWriter

You can just create a SAXWriter by calling SAXWriter writer=new SAXWriter(java.io.Writer) or SAXWriter writer=new SAXWriter(String fileName)

The SAXWriter has a comparable interface to ContentHandler so you can just write an XML file as you would read one:
Before starting to write call startDocument() and end writing by calling endDocument().
If you want the xml definition at the start call insterDescriptor()
The normal startElement and endElement are provided, but if you want to write an element with only attributes you can use insertElement(..)
You can use startComment(), setContent(String) and endComment() to write comments to your XML file

Note for JDK1.3 users

This version of Saxo relays on the org.sax.* classes supplied with JDK1.4 and further. While these were not present in JDK 1.3 to use Saxo you need to download the interface separatly and include it in your classpath

Reference implementation/examples

  • Anglo 0.10+
  • BoxIt 0.31+
  • CoffeeBreak 0.20+
  • CrossWord 0.20+
  • Huie 0.20+
  • Struct 0.24+
  • XmlForm 0.10+

releases

Saxo 1.10

  • Just an update of the project and version information

Saxo 0.20

  • Finally implemented Sax2 interface

Saxo 0.10

  • Sax1 complaint Sax parser