Monday 3 September 2007

xmlbeans for the impatient

I've been looking at xmlbeans today. There is a fairly steep initial learning curve, then it gets very easy and amazingly impressive. It really is a very wonderful library which will save you a lot of time and code if you every read and write XML files.

There is an introduction at Apache which is either buggy or out of date. Luckily, a colleague who knows the library well was on hand to point me in the right direction. I have packaged up a modified and extended version of the Apache introduction and put the jar here for anyone who want to get started with no reading whatsoever. The jar includes an ant build file. The default ant target will compile everything and run the 'print' example. There are also targets 'add-item' and 'save-order' run two more examples.

After extracting the jar, you will need to cd into the xmlbeans directory, make the 'lib' directory and copy these files into it:

asm.jar
jsr_api.jar
resolver.jar
saxon8.jar
xbean.jar
xbean_xpath.jar
xmlbeans-qname-2.3.0.jar
xmlpublic.jar

You will need to read the xmlbeans install guide to find these files.

1 comment:

Mike Wilson said...

The files were lost when I moved the site to a new host. If anyone wants them, please e-mail me and I will put them back.