Wednesday, October 28, 2009

An XML spell list

Today, I got to thinking about XML. Last night I was poking a bit more at the z20 spell list, slowly importing/converting things from d20, and realized what a hassle it was. I'm doing way too much formatting and linking by hand in HTML. Instead, I should probably be making a separate XML document, which I could then format differently for different needs. I'm comfortable with the theory behind XML documents, but I've never created and reformatted one of my very own. So I got to wondering if anyone's come up with a standard DTD or schema for d20 spell lists. Some searching ensued, with the following results:

http://www.andargor.com/
The biggest name/site I found in regards to still-active d20 XML. In the latest version (zipped XML+SQL bundle), the XML includes markup of spell details, but also a fulltext section including a table-based HTML view as well.

I was more interested in his "obsolete" version (2004) of only spells and monsters, which includes only XML markup of the spells. The OGL licence suggests this came through the PCGen Character Generator project somehow.

The oldest version of all (2003) includes an XSLT as well, for decent formatting. This is what I have in mind for z20--a nicely marked up XML backend with different formatting options through XSLT (or similar tools). The content isn't itself quite a clean as the previous option though.

The site also has an XML markup of the whole SRD, though this XML simply marks tables, rows, cells, and paragraphs.

http://www.darkshire.net/jhkim/rpg/srd/spells/index.html
From John Kim's more general SRD page, this page includes a zipped XML file of the spell details. This is from the 3.0 version of the SRD though. Sadly, the online CGI options to search through it don't seem to work.

http://games.groups.yahoo.com/group/d20-xml/
A Yahoo! Group that ran from 2000 to about 2006 working towards a complete d20 XML schema for character creation and possibly even gameplay. I did not read more than a few of the first posts and the last posts. Different people were working on their own projects, and no consensus or central DTD was apparently formed.

http://xmld20.crwth.org:8080/
A personal d20 XML project--spinning off from the d20-xml group--to get an XSchema for all the d20 content. The focus is on having the XML usable by software tools, so machine-readable is preferred over human-readable. (I agree with that approach, since you should be using XSTL if you want truly human-readable output.) However, the project focused more on characters and monsters and the rules logic than simply data storage. The project ended in 2008 (or, rather, rolled into a different approach using Lua).


Conclusion: There is no readily available XML schema for d20 content because everyone has different needs. PCGen and OpenRPG are doing some XML stuff backend, but that doesn't really fit what I'm going to do. So I'm on my own... which is probably just as well.

My current thought is that it'd be fun to play around with the different d20 XML versions I downloaded, and to try generating a HTML snapshot page of each spell pulled from different versions of the SRD. Then I could build a z20 spell list, and pull those into the same snapshot pages for comparison. I've been meaning to learn more about XML, XSchemas, XPath, XSLT, etc. for some time. But I really don't need a new project right now! So we'll see what happens.

No comments: