I really enjoy using XML for game data.
I have been using XML for Stolen Notebook projects for a while and it has worked out extremely well. The syntax kind of sucks, but if you use any of the readily available XML editors like XMLpad or XMLShell, this isn’t so much of an issue.
There are actually a few ways of storing data in the XML format. However, there isn’t much information about using XML for defining game data. When I was adding XML support to our current engine I didn’t really have a good idea how to store the data or the benefits of the various possiblities. I ended up having all data defined as properties of tags. Mainly because it’s easier to parse with the XML library I was using.
I was browsing around the web the other day, and happened on MoonPod’s Development Diary and a post about using XML for game data. I used the second method described in the post. If you are thinking about storing your game data in XML — and I recommend you do — then you should definiately check it out. If you aren’t interested in XML for game data check out their development diary anyway, it’s very interesting.
EDIT: If you decide to use XML I suggest you use an XML editor if you decide to edit XML by hand. I was working with a shader and wondering why it wasn’t compiling, and it turned out that I was using a ‘<' which should be written as '<' in XML. It sucks to look at and type, an XML editor would do this automatically and you wouldn't notice the difference.
Isn’t XSD considered to be a better choice than DTD these days though for schemas?
That’s what I hear. XSD is supposed to replace DTD. I only briefly looked at DTD. I never understood why DTD syntax was so different from XML.
XSD seems much better and adds many useful features that I’d like to use one day. Specifically, the type system that allows you to specify what type properties should be (string, int, etc). It even lets you create regular expressions for new types!