XML Schema 'referenced enumeration'?

wxdqz

New Member
Sorry about the subject, couldn't think of anything else descriptive enough of the problem.

Basically, I would like to specify a number of locations that a config file could currently be located. These locations would be arbitrary xs:string types. I'd like to be able to use one or more of these location values in the attributes of other tags. Then I'd like to specify the currently used location. This is all a lot less complicated than it sounds, honest.


<current-location>local</current-location>
<locations>
<location>local</location>
<location>remote</location>
<location>testing</location>
</locations>
<site-name location="local,remote">My Site</site-name>
<site-name location="testing">My Site (testing)</site-name>
<debugging location="local,remote">false</debugging>
<debugging location="testing">true</debugging>


So you see how I can have one config file and simply copy it and change the current-location tag to generate different behaviour.

Presently, I use C#, XPath and some dirty code to read through these values and determine the outcome - which is why I can get away with comma-delimited values in location attributes. However, this method has proved popular where I work and in order to make it official I need to be able to create a schema to describe it and from that create a typed DataSet.

Referring to the subject, the only way I could think of enforcing the location attribute to accept only values specified in the locations tag would be to have some kind of enumeration that references the locations tag. I doubt this is possible though. Even if it is, then I have the issue of the location attribute being comma-delimited which is invalid.

Firstly, does anyone have any idea what I'm talking about? Secondly, could you see a possible solution?
 
Back
Top