1
<?xml version="1.0" encoding="UTF-8"?>
2
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/mso"
3
	xmlns:tns="http://www.example.org/mso" elementFormDefault="qualified">
4
	<complexType name="limitationType">
5
		<attribute name="name" type="NCName" use="optional" />
6
		<attribute name="value" type="string" use="optional" />
7
		<attribute name="expression" type="string" use="optional" />
8
	</complexType>
9
	<complexType name="msoMemberType" abstract="true">
10
		<choice maxOccurs="unbounded" minOccurs="0">
11
			<element name="limitation" type="tns:limitationType" />
12
		</choice>
13
		<attribute name="name" type="NCName" use="required" />
14
		<attribute name="array" type="boolean" use="optional"
15
			default="false" />
16
		<attribute name="count" type="string" use="optional" />
17
		<attribute name="minOccurs" type="string" use="optional" />
18
		<attribute name="maxOccurs" type="string" use="optional" />
19
		<attribute name="condition" type="string" use="optional" />
20
	</complexType>
21
	<complexType name="intType">
22
		<complexContent>
23
			<extension base="tns:msoMemberType">
24
				<attribute name="default" type="int" use="optional" />
25
			</extension>
26
		</complexContent>
27
	</complexType>
28
	<complexType name="typeType">
29
		<complexContent>
30
			<extension base="tns:msoMemberType">
31
				<attribute name="type" type="NCName" use="required" />
32
				<attribute name="optional" type="boolean" use="optional"
33
					default="false" />
34
				<!-- if the size is know it can be specified here as an expression -->
35
				<attribute name="size" type="string" use="optional" />
36
			</extension>
37
		</complexContent>
38
	</complexType>
39
	<complexType name="fixedChoiceType">
40
		<choice minOccurs="2" maxOccurs="unbounded">
41
			<element name="text" type="string" />
42
			<element name="hex" type="hexBinary" />
43
		</choice>
44
		<attribute name="name" type="NCName" use="required" />
45
		<attribute name="optional" type="boolean" use="optional"
46
			default="false" />
47
	</complexType>
48
	<complexType name="choiceType">
49
		<sequence>
50
			<element name="type" minOccurs="2" maxOccurs="unbounded">
51
				<complexType>
52
					<attribute name="type" type="NCName" use="required" />
53
				</complexType>
54
			</element>
55
		</sequence>
56
		<attribute name="name" type="NCName" use="required" />
57
		<attribute name="optional" type="boolean" use="optional"
58
			default="false" />
59
	</complexType>
60
	<complexType name="structType">
61
		<sequence>
62
			<choice maxOccurs="unbounded" minOccurs="0">
63
				<element name="bit" type="tns:intType" />
64
				<element name="int16" type="tns:intType" />
65
				<element name="int32" type="tns:intType" />
66
				<element name="uint2" type="tns:intType" />
67
				<element name="uint3" type="tns:intType" />
68
				<element name="uint4" type="tns:intType" />
69
				<element name="uint5" type="tns:intType" />
70
				<element name="uint6" type="tns:intType" />
71
				<element name="uint7" type="tns:intType" />
72
				<element name="uint8" type="tns:intType" />
73
				<element name="uint9" type="tns:intType" />
74
				<element name="uint12" type="tns:intType" />
75
				<element name="uint13" type="tns:intType" />
76
				<element name="uint14" type="tns:intType" />
77
				<element name="uint15" type="tns:intType" />
78
				<element name="uint16" type="tns:intType" />
79
				<element name="uint20" type="tns:intType" />
80
				<element name="uint30" type="tns:intType" />
81
				<element name="uint32" type="tns:intType" />
82
				<element name="type" type="tns:typeType" />
83
				<element name="choice" type="tns:choiceType" />
84
				<element name="fixedchoice" type="tns:fixedChoiceType" />
85
				<element name="text" type="string" />
86
				<element name="hex" type="hexBinary" />
87
			</choice>
88
			<element name="limitation" type="tns:limitationType"
89
				minOccurs="0" maxOccurs="unbounded" />
90
		</sequence>
91
		<attribute name="name" type="NCName" use="required" />
92
	</complexType>
93
	<complexType name="msoType">
94
		<sequence>
95
			<element name="const" minOccurs="0" maxOccurs="unbounded" />
96
			<element name="struct" type="tns:structType" minOccurs="0"
97
				maxOccurs="unbounded">
98
				<unique name="uniqueMembers">
99
					<selector xpath="*" />
100
					<field xpath="@name" />
101
				</unique>
102
			</element>
103
			<element name="stream" minOccurs="0" maxOccurs="unbounded" />
104
		</sequence>
105
	</complexType>
106
	<element name="mso" type="tns:msoType">
107
		<key name="uniqueStructs">
108
			<selector xpath="tns:struct" />
109
			<field xpath="@name" />
110
		</key>
111
		<keyref name="structRef" refer="tns:uniqueStructs">
112
			<selector xpath="tns:struct/tns:type" />
113
			<field xpath="@type" />
114
		</keyref>
115
		<keyref name="structRef2" refer="tns:uniqueStructs">
116
			<selector xpath="tns:struct/tns:choice/tns:type" />
117
			<field xpath="@type" />
118
		</keyref>
119
	</element>
120
</schema>