-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
With the structure of a server's settings.xml I have encountered an issue that I could not fully resolve. In a settings.xml there can be a number of unique tags (actually, all despite the <resource>-Tag) as well as the <resource>-Tag which can be used multiple times on the same level.
Furthermore I wanted to ensure that there's a <servername>- and <maxplayers>-Tag present in every settings.xml.
It would be easy to achieve in XSD 1.1 like shown below, however Visual Studio would not support that version:
<xs:all>
<xs:element ref="servername" />
<xs:element ref="maxplayers" />
<xs:element ref="password" minOccurs="0" maxOccurs="1" />
<!-- ... -->
<xs:element ref="allowcefdevtool" minOccurs="0" maxOccurs="1" />
<xs:element ref="resource" minOccurs="0" maxOccurs="unbounded" />
</xs:all>
So, the only possible options that I have discovered yet are those compromises:
- Use a
sequence, but then the XML tags would have to be in a given order. - Use a
choice. In this case all tags can be used multiple times. A minimum occurence is hard to achieve. The current solution generally involves this compromise with a little "tweak" to make the former specified tags required and unique by combining it with asequence.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels