Monday, February 27, 2006

XMHell... Aha! A pun!

i decided that i recently wanted to have a nice,simple, readable data format for my projects to make inputting data simple and as generic as possible. I thought it would be quite nice, just for kicks you understand, to write an XML parser, of sorts, to contain the input data.

It worked out quite nicely. I fear i have somewhat raped the language but i use only a very limited subset of the syntax, and a few homebrew things, but the documents look nice at least. Another advantage is that one ends up with a very useful tree in memory once you have loaded up the xml file. I have made it so you can access your data through a kind of dot (".") operator. For example, we may have a piece of pseudo-xml that looks like this:
[cookies]
[chocolate yumminess=1/]
[ginger yumminess=2/]
...
[/cookies]

And then you can access the data just through a cookies.chocolate syntax.

So that is nice. I have rather lost my train of thought though. Bye!

0 Comments:

Post a Comment

<< Home