What is tXML?
tXML stands for "tiny XML". It is a Java XML parsing and searching
engine, designed for messaging and data exchange (btw, if you
are looking for a text formatting engine, you are in the wrong place!).
It is a development library (JAR file), not an end-user product.
tXML code is very small: JAR file is less than 6K.
The design goal is to make XML interface simple. The cost paid is
(i) standard conformance (tXML does not conform to any of
existing Java XML APIs), and (ii) it does not implement XML it its full glory
(or, rather, misery. It is my belief that XML as a language is unnecessarily
heavy... - see XML Sucks!).
tXML runs on JVM version 1.1 and up (i.e. you can use it
in browsers that support only Java 1.1). It can parse XML files (with
some syntax restrictions, see below),
and do selection queries on an XML tree using XPath syntax.
What part of XML syntax is NOT implemented in tXML?
Well, here is the list (not exhaustive):
- tXML does not accept (or generates) tag
attributes.
- tXML does not understand META directives (namespaces,
DTD, stylesheets). Of course, this means, that tXML
parser is not a validating one.
Also, tXML relaxes the "special" meaning of many symbols. In fact,
only '<', '>', and '&' are special in tXML. As a result,
tXML allows more freedom in tag naming, though use of this freedom
is not recommended, because it would create something that only tXML can parse.
The tXML is useful for:
- Parsing XML-styled configuration data. It can be
thought as a replacement for
java.util.Properties-formatted configuration format.
The advantages of tXML (comparing to java.util.Properties):
- Allows for a hierarchically structured
configuration data.
- Much simpler handling of lists and arrays of
configuration items.
- As a uniform format for communication between program parts
(i.e. as a messaging protocol). Its convenient because:
- It is easy to code and debug due to the well-known
XML document syntax.
- It is efficient: XML node object in tXML
is just a few bytes bigger than
java.lang.String.
Resources
tXML is an open source project, distributed under the terms
of LGPL (Lesser GNU Public License).
- Download
- txml-src: source code. Should compile the JAR, run tests and generate Javadoc API reference. Build process is fairly platform-independent. However, it was tested on Linux only.
- txml-jar: JAR file only
- Installation instructions
- Documentation
Bug reports and general comments are welcome: drop me a mail.
Regards,
Mike