Welcome to WebmasterWorld Guest from

Forum Moderators: httpwebwitch

Message Too Old, No Replies

Trouble writting Schemas for my app

Trying to define many doctypes in a single XSD



3:09 pm on May 5, 2006 (gmt 0)

10+ Year Member

The project I'm working on is about a role-playing game (a classic paper&dice one), which requires lots of online material (spell lists, object lists, characters sheets and more). I don't want to go further into specifics, so I'll use the most generic but descriptive examples possible:
Let's assume I have a file like that (it's very simplified, but it'll do):
<?xml version="1.0" encoding="utf-8"?>
<spell id="fireball">
<effect>blah blah and some additional blah... my question is NOT about the effects of a fireball :P</effect>

And now consider this other file:
<?xml version="1.0" encoding="utf-8"?>
<spell id="counterspell">
<effect>Some blah blah blah, of course!</effect>
<spell src="spell.xml"/>

That is what I want to do:
1) Create a single XML Schema (XSD) file that defines both the spell and the spellbook element (up to this point, I guess I've done it); and associate each xml file to the correct part of the XSD; so I don't need to define the spell object and then define it as a component of a spellbook.
2) Let the XSD (or the validator software) know that the src attribute means the content of the object is in another file (look at the line <spell src="spell.xml"/> )
I might use any alternative to the src attribute, and I'm even considering the use of xlink:href, but that's not the point.
Does somebody know how to do this, or where can I find documentation about this use of schemas?



Featured Threads

Hot Threads This Week

Hot Threads This Month