ZPath

ZPath a Java library to easy create XML in program using XPath-like syntax.

Description

Read of XML file in Java is relative comfortable: you can use DOM or SAX parsers. One step forward - XPath, where you can define which exactly information do you need at the moment.

One can create an XML tree from scratch using the DOM too, but then he needs a lot of operations to control which tag has to be created, with attributes and where it must be placed in the tree. The ZPath library tries to solve this problem by defining XPath-like syntax, but it allows not only receiving existing information from the tree but also writing a new one.

Not all XPath possibilities can be implemented in ZPath because e.g. some expressions return a set of elements with unknown names, which cannot be created.

Limitations

This library was initially written for some project, but the project is dead now and I (as the author) have decided to publish the source code. So, not all possible operations are implemented, only whose was needed by the initial project. And the library is not well tested. But sometimes it works :)

Usage

Download the library, compile it with Ant and run it: java -cp classes ak.zpath.DocumentTree

It will create two files where you can see some example operations. Then have a look into ak.zpath.DocumentTree.main() source code (at the end of file) to understand the syntax.

Licence

Public domain - you are allowed to use it in any way.

Download

The project is available as source code via Subversion repository or for on-line view. Subversion URL is https://www.26th.net/svn/general/zpath/trunk/

Support

The library is provided AS IS without any warranty. I do not promise anything about it.

But nevertheless if you found a bug or require some feature - please submit it to bugzilla.

If you have some questions or problems with the library - ask me per email.

Once again - no warranty.

© Anatoli Klassen