Lists Home |
Date Index |
I am pleased to announce a new version of RelaxNGCC, a compiler compiler
for XML by using RELAX NG.
RelaxNGCC allows you to quickly write a code to read XML documents into
your application-specific data structure or to process them in a stream
fashion. IOW, RelaxNGCC is a data-binding tool specialized to read XML
The tool is available under the GPL at:
Code generated by RelaxNGCC is all yours and we don't place any
restriction on how it's going to be used.
The documents are available at:
Let me explain a bit about how RelaxNGCC is useful.
Writing code to parse XML into an application-specific object model is a
pain in the neck, especially with SAX. This is why a lot of people use
DOM. But DOM is not quite a solution. You lose all the source location
information, pays a performance penalty, and worst of all, you still
need to work with untyped bare tree. That reminds me of old days when
we've processed files as a byte stream.
RelaxNGCC solves these problems. It solves these problems in a way very
much like how yacc/bison/JavaCC/ANTLR solves those problem for arbitrary
file format. With those compiler-compilers, you write a grammar in the
context free grammar, you add your code, and the compiler turns them
into an efficient parser. With RelaxNGCC, you write a grammar in RELAX
NG, you add your code, and the compiler turns them into an efficient
ContentHandler that processes SAX events.
Enjoy, and let us know how you think of it.