-
Notifications
You must be signed in to change notification settings - Fork 0
/
textGameXmlSchema.xsd
50 lines (42 loc) · 1.87 KB
/
textGameXmlSchema.xsd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema version="1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xsd:element name="game" type="gameType">
<xsd:unique name="sceneUnique">
<xsd:selector xpath="./scene"/>
<xsd:field xpath="./@id"/>
</xsd:unique>
</xsd:element>
<xsd:complexType name="gameType">
<xsd:sequence>
<xsd:element name="scene" type="sceneType" minOccurs="2" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="name" type="nonEmptyString" use="required"/>
<xsd:attribute name="startingScene" type="xsd:positiveInteger" use="required"/>
</xsd:complexType>
<xsd:complexType name="sceneType">
<xsd:sequence>
<xsd:element name="name" type="nonEmptyString" minOccurs="1" maxOccurs="1"/>
<xsd:element name="description" type="xsd:string" minOccurs="1" maxOccurs="1"/>
<xsd:element name="choices" type="choicesType" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:positiveInteger" use="required"/>
</xsd:complexType>
<xsd:complexType name="choicesType">
<xsd:sequence>
<xsd:element name="choice" type="choiceType" minOccurs="0" maxOccurs="4"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="choiceType">
<xsd:sequence>
<xsd:element name="text" type="nonEmptyString" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="goTo" type="xsd:positiveInteger" use="required"/>
</xsd:complexType>
<xsd:simpleType name="nonEmptyString">
<xsd:restriction base="xsd:string">
<xsd:minLength value="1"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>