The XMLIO Component

XMLIO is a low level library to assist you in the straight forward process of importing and exporting XML from and to your Java applications. All of this has been designed having performance and simplicity in mind. No magic is involved. Additionally, it is very lightweight and has exactly no dependencies on any other libraries.

XMLIO consists of three parts:

Structured reading of XML

XMLIO's main part - SimpleImporter - is a simple and fast importer for XML.

It is based on SAX and can be considered an extension to it. This means it is callback oriented and does not build an internal data structure like the DOM. No data access objects (DAO) will be created either. This means it is no XML->Java Object Mapper, but rahter a XML->Generic Mehtod Mapper (if there was anything like this). You could easily use the simply importer without a single dynamic construction of a class.

Comparing it to Commons Digester the simple importer is much more low level and much more simplistic. Beside SimpleImporter you will only need to know the call back interface .

While preserving all benefits of SAX - among them performance, simplicity and general usability - the simple importer adds more high level means to SAX's rudimentary features. These are the main extensions:

  1. Every callback includes a full path to the XML element: In many cases this will make maintaining local stacks for keeping track of element histories obsolete.
  2. Leading character data can be included into start element callback: In many cases import files do not or only rarely contain mixed content. If so it is convenient to have the full content of an element at hand with a single callback.
  3. More than one listener can be registered: Some XML files contain different types/aspects of data that may be interesting to different listeners. E.g. data to import from a server may contain error messages along with the real content data. It may be convenient to processes these blocks of data separately. Another example is a debug or log listener.

Writing data to formatted XML

You can write your data into a formatted XML writer. Formatting and encoding is done as straight forward as possible. Everything you know better than this class must be done by you. In effect, no unexpected so called intelligent behavior or magic is to be feared. Another effect is high speed and simplicity.

XML encoding and decoding helpers on the character (not the byte) level

Set of methods to encode and decode characters special to XML like (& and < and " and ').

Releases

See the downloads page for information on obtaining releases.

Documentation

The JavaDoc API documents are available online.

Class diagrams

For an easy overview there is a class diagram for the input part and one for the output part in PDF format.