-
Notifications
You must be signed in to change notification settings - Fork 1
/
openmath2.xsd
218 lines (218 loc) · 6.93 KB
/
openmath2.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<?xml version="1.0" encoding="UTF-8"?>
<!-- RELAX NG Schema for OpenMath 2 -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.openmath.org/OpenMath" xmlns:om="http://www.openmath.org/OpenMath">
<!-- OpenMath object constructor -->
<xs:element name="OMOBJ">
<xs:complexType>
<xs:group ref="om:omel"/>
<xs:attributeGroup ref="om:compound.attributes"/>
<xs:attribute name="version" type="xs:string"/>
</xs:complexType>
</xs:element>
<!-- Elements which can appear inside an OpenMath object -->
<xs:group name="omel">
<xs:choice>
<xs:element ref="om:OMS"/>
<xs:element ref="om:OMV"/>
<xs:element ref="om:OMI"/>
<xs:element ref="om:OMB"/>
<xs:element ref="om:OMSTR"/>
<xs:element ref="om:OMF"/>
<xs:element ref="om:OMA"/>
<xs:element ref="om:OMBIND"/>
<xs:element ref="om:OME"/>
<xs:group ref="om:OMATTR"/>
<xs:element ref="om:OMR"/>
</xs:choice>
</xs:group>
<!-- things which can be variables -->
<xs:group name="omvar">
<xs:choice>
<xs:element ref="om:OMV"/>
<xs:group ref="om:attvar"/>
</xs:choice>
</xs:group>
<xs:group name="attvar">
<xs:sequence>
<xs:element name="OMATTR">
<xs:complexType>
<xs:sequence>
<xs:element ref="om:OMATP"/>
<xs:choice>
<xs:element ref="om:OMV"/>
<xs:group ref="om:attvar"/>
</xs:choice>
</xs:sequence>
<xs:attributeGroup ref="om:common.attributes"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:group>
<xs:attributeGroup name="cdbase">
<xs:attribute name="cdbase" type="xs:anyURI"/>
</xs:attributeGroup>
<!-- attributes common to all elements -->
<xs:attributeGroup name="common.attributes">
<xs:attribute name="id" type="xs:ID"/>
</xs:attributeGroup>
<!-- attributes common to all elements that construct compount OM objects. -->
<xs:attributeGroup name="compound.attributes">
<xs:attributeGroup ref="om:common.attributes"/>
<xs:attributeGroup ref="om:cdbase"/>
</xs:attributeGroup>
<!-- symbol -->
<xs:element name="OMS">
<xs:complexType>
<xs:attributeGroup ref="om:common.attributes"/>
<xs:attribute name="name" use="required" type="xs:NCName"/>
<xs:attribute name="cd" use="required" type="xs:NCName"/>
<xs:attributeGroup ref="om:cdbase"/>
</xs:complexType>
</xs:element>
<!-- variable -->
<xs:element name="OMV">
<xs:complexType>
<xs:attributeGroup ref="om:common.attributes"/>
<xs:attribute name="name" use="required" type="xs:NCName"/>
</xs:complexType>
</xs:element>
<!-- integer -->
<xs:element name="OMI">
<xs:complexType>
<xs:simpleContent>
<xs:restriction base="xs:anyType">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="\s*(-\s?)?[0-9]+(\s[0-9]+)*\s*"/>
</xs:restriction>
</xs:simpleType>
<xs:attributeGroup ref="om:common.attributes"/>
</xs:restriction>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<!-- byte array -->
<xs:element name="OMB">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:base64Binary">
<xs:attributeGroup ref="om:common.attributes"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<!-- string -->
<xs:element name="OMSTR">
<xs:complexType mixed="true">
<xs:attributeGroup ref="om:common.attributes"/>
</xs:complexType>
</xs:element>
<!-- IEEE floating point number -->
<xs:element name="OMF">
<xs:complexType>
<xs:attributeGroup ref="om:common.attributes"/>
<xs:attribute name="dec" type="xs:double"/>
<xs:attribute name="hex">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[0-9A-F]+"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<!-- apply constructor -->
<xs:element name="OMA">
<xs:complexType>
<xs:group maxOccurs="unbounded" ref="om:omel"/>
<xs:attributeGroup ref="om:compound.attributes"/>
</xs:complexType>
</xs:element>
<!-- binding constructor -->
<xs:element name="OMBIND">
<xs:complexType>
<xs:sequence>
<xs:group ref="om:omel"/>
<xs:element ref="om:OMBVAR"/>
<xs:group ref="om:omel"/>
</xs:sequence>
<xs:attributeGroup ref="om:compound.attributes"/>
</xs:complexType>
</xs:element>
<!-- variables used in binding constructor -->
<xs:element name="OMBVAR">
<xs:complexType>
<xs:group maxOccurs="unbounded" ref="om:omvar"/>
<xs:attributeGroup ref="om:common.attributes"/>
</xs:complexType>
</xs:element>
<!-- error constructor -->
<xs:element name="OME">
<xs:complexType>
<xs:sequence>
<xs:element ref="om:OMS"/>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="om:omel"/>
<xs:element ref="om:OMFOREIGN"/>
</xs:choice>
</xs:sequence>
<xs:attributeGroup ref="om:common.attributes"/>
</xs:complexType>
</xs:element>
<!-- attribution constructor and attribute pair constructor -->
<xs:group name="OMATTR">
<xs:sequence>
<xs:element name="OMATTR">
<xs:complexType>
<xs:sequence>
<xs:element ref="om:OMATP"/>
<xs:group ref="om:omel"/>
</xs:sequence>
<xs:attributeGroup ref="om:compound.attributes"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:group>
<xs:element name="OMATP">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element ref="om:OMS"/>
<xs:choice>
<xs:group ref="om:omel"/>
<xs:element ref="om:OMFOREIGN"/>
</xs:choice>
</xs:sequence>
<xs:attributeGroup ref="om:compound.attributes"/>
</xs:complexType>
</xs:element>
<!-- foreign constructor -->
<xs:element name="OMFOREIGN">
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="om:omel"/>
<xs:group ref="om:notom"/>
</xs:choice>
<xs:attributeGroup ref="om:compound.attributes"/>
<xs:attribute name="encoding" type="xs:string"/>
</xs:complexType>
</xs:element>
<!--
Any elements not in the om namespace
(valid om is allowed as a descendant)
-->
<xs:group name="notom">
<xs:sequence>
<xs:choice minOccurs="0">
<xs:any namespace="##other" processContents="skip"/>
<xs:any namespace="##local" processContents="skip"/>
</xs:choice>
</xs:sequence>
</xs:group>
<!-- reference constructor -->
<xs:element name="OMR">
<xs:complexType>
<xs:attributeGroup ref="om:common.attributes"/>
<xs:attribute name="href" use="required" type="xs:anyURI"/>
</xs:complexType>
</xs:element>
</xs:schema>