[3.5] Spells in MySQL and pseudo-XML format


log in or register to remove this ad


Anabstercorian said:
You know, I was actually doing a project with MySQL this summer and I was thinking of doing this... Now I'm curious... How did YOU do it?

In the mangled words of the tongue of Shakespeare: "I am da parse masta" :D

I just parsed the RSRD documents, did some obscure arcane incantations (9th Level Spell: Perl) , and voilà!

Andargor
 



Yay! I had previously done a MySQL database for my little character manager/random spellbook generator, but this has so much more to it! Thanks! :D

Now, I'm off to do some super sneaky non-SRD spell adding...
 

Jeranon said:
I don't suppose you'll be doing this with the monsters as well? :)

Hmmm. Interesting idea. Might help out my DM some. I'll take a look at it over the weekend.

Everything can be parsed! Everything! :)

Andargor
 

Andargor,

I downloaded the file, but when I click on it, I get the error

"The XML page cannot be displayed"
"A name contained an invalid character. Error processing resource 'file:///C:/Documents and Settings/SirWhiskers/Desktop/spells35_28072003_01/srd35.xml'. Line 8, Position 14 "

Any ideas?

Also, as I know nothing about MySQL: can I use this file to import the info into an Access db? I plan on *eventually* getting the 3.5 spell, item, and monster info into a new db for our gm's to use, and it sounds like your stuff would save me a lot of typing.

Thanks for all your efforts!
 

Sir Whiskers

As andargor said, it is pseudo xml (actually it is not well-formed xml).
You have to convert all the element names to single words. An element name is the text between < and > or between </ and >. The error you get (if memory serves me) is because casting time is two words instead of one. Try to do a search and replace for casting time with casting_time. Then repeat ad naseum until all errors has been corrected.

Regarding the SQL code. The syntax is not fully compatible with access (especially depending on the version of access you ar using). with some tweaking you should be able to import it into access 2000 or later.
Look for \\' between text delimeters (' ) and replace them with '' (that is two single '. The longtext is not supported, so you have to use varchar(8000) or text.

Andargor,
Thank you for your work, it is much appreciated (sp?).

/F

edit: backslash did not appear in first try
 
Last edited:

I downloaded the file, but when I click on it, I get the error

The problem is that some of the xml tags (saving throw, for example) have spaces, which neither IE or Mozilla care for.

I did a little text parsing of my own to make it a real xml file, which I'd be happy to send to Andargor if he'd like to host it instead of the current one.

The changes are:
  • removed spaces from tags
  • changed the degree symbol to the word "degrees"
  • made a top level tag "spell list" (required for xml specs)
  • Created a css style sheet to display everything with pretty colors and simple formatting

These were minor changes, Andargor definitely did all the hard work.

SJ
 

Remove ads

Top