Monday, August 22, 2005

It's not XML - it's not YAML - it's SPaML!

I'm currently working on a project that requires a lot of XSLT 2.0 transformations. Since I'm doing Test Driven Development, I am relying heavily on XMLUnit. (Bless you, Tim and Jeff).

However, I've been spending more time than I want to writing XML test documents.

So I created SPaML - the Simplest Possible Markup Language. It's very concise, and allows me to specify a complex document in a short line of text.

Here's a SPaML document (quoted, as it would be in a JUnit TestCase):

"(map file=foo(branch id=0(branch id=1(text{bar}))(branch id=2)))"

The corresponding XML is about three times as long, with escaped quotes. Horrid to read, tedious to write, and very error prone. Don't you just love it when you've got bugs in your test data!

I've written a SPaML converter in Java, and will probably port it to C#.
If anyone is interested, drop me a note: romilly(at)

No comments: