summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/stex/schema/rng/mathml3-common.rng
blob: 612e635a83d069982daaff9549959e0bc647a084 (plain)
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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
<?xml version="1.0" encoding="UTF-8"?>
<!--
      This is the Mathematical Markup Language (MathML) 3.0, an XML
      application for describing mathematical notation and capturing
      both its structure and content.
  
      Copyright 1998-2009 W3C (MIT, ERCIM, Keio)
  
      Use and distribution of this code are permitted under the terms
      W3C Software Notice and License
      http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
-->
<grammar ns="http://www.w3.org/1998/Math/MathML" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <start>
    <ref name="math"/>
  </start>
  <define name="math">
    <element name="math">
      <ref name="math.attributes"/>
      <zeroOrMore>
        <ref name="MathExpression"/>
      </zeroOrMore>
    </element>
  </define>
  <define name="MathExpression">
    <ref name="semantics"/>
  </define>
  <define name="NonMathMLAtt">
    <attribute>
      <anyName>
        <except>
          <nsName ns=""/>
          <nsName/>
        </except>
      </anyName>
      <data type="string"/>
    </attribute>
  </define>
  <define name="CommonDeprecatedAtt">
    <optional>
      <attribute name="other"/>
    </optional>
  </define>
  <define name="CommonAtt">
    <optional>
      <attribute name="id">
        <data type="ID"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="xref"/>
    </optional>
    <optional>
      <attribute name="class">
        <data type="NMTOKENS"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="style">
        <data type="string"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="href">
        <data type="anyURI"/>
      </attribute>
    </optional>
    <ref name="CommonDeprecatedAtt"/>
    <zeroOrMore>
      <ref name="NonMathMLAtt"/>
    </zeroOrMore>
  </define>
  <define name="math.attributes">
    <ref name="CommonAtt"/>
    <optional>
      <attribute name="display">
        <choice>
          <value>block</value>
          <value>inline</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="maxwidth">
        <ref name="length"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="overflow">
        <choice>
          <value>linebreak</value>
          <value>scroll</value>
          <value>elide</value>
          <value>truncate</value>
          <value>scale</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="altimg">
        <data type="anyURI"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="altimg-width">
        <ref name="length"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="altimg-height">
        <ref name="length"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="altimg-valign">
        <choice>
          <ref name="length"/>
          <value>top</value>
          <value>middle</value>
          <value>bottom</value>
        </choice>
      </attribute>
    </optional>
    <optional>
      <attribute name="alttext"/>
    </optional>
    <optional>
      <attribute name="cdgroup">
        <data type="anyURI"/>
      </attribute>
    </optional>
    <ref name="math.deprecatedattributes"/>
  </define>
  <!--
    the mathml3-presentation schema  adds additional attributes
    to the math element, all those valid on mstyle
  -->
  <define name="math.deprecatedattributes">
    <optional>
      <attribute name="mode">
        <data type="string"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="macros">
        <data type="string"/>
      </attribute>
    </optional>
  </define>
  <define name="name">
    <attribute name="name">
      <data type="NCName"/>
    </attribute>
  </define>
  <define name="cd">
    <attribute name="cd">
      <data type="NCName"/>
    </attribute>
  </define>
  <define name="src">
    <optional>
      <attribute name="src">
        <data type="anyURI"/>
      </attribute>
    </optional>
  </define>
  <define name="annotation">
    <element name="annotation">
      <ref name="annotation.attributes"/>
      <text/>
    </element>
  </define>
  <define name="annotation-xml.model">
    <zeroOrMore>
      <choice>
        <ref name="MathExpression"/>
        <ref name="anyElement"/>
      </choice>
    </zeroOrMore>
  </define>
  <define name="anyElement">
    <element>
      <anyName>
        <except>
          <nsName/>
        </except>
      </anyName>
      <zeroOrMore>
        <choice>
          <attribute>
            <anyName/>
          </attribute>
          <text/>
          <ref name="anyElement"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="annotation-xml">
    <element name="annotation-xml">
      <ref name="annotation.attributes"/>
      <ref name="annotation-xml.model"/>
    </element>
  </define>
  <define name="annotation.attributes">
    <ref name="CommonAtt"/>
    <optional>
      <ref name="cd"/>
    </optional>
    <optional>
      <ref name="name"/>
    </optional>
    <ref name="DefEncAtt"/>
    <optional>
      <ref name="src"/>
    </optional>
  </define>
  <define name="DefEncAtt">
    <optional>
      <attribute name="encoding">
        <data type="string"/>
      </attribute>
    </optional>
    <optional>
      <attribute name="definitionURL">
        <data type="anyURI"/>
      </attribute>
    </optional>
  </define>
  <define name="semantics">
    <element name="semantics">
      <ref name="semantics.attributes"/>
      <ref name="MathExpression"/>
      <zeroOrMore>
        <choice>
          <ref name="annotation"/>
          <ref name="annotation-xml"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="semantics.attributes">
    <ref name="CommonAtt"/>
    <ref name="DefEncAtt"/>
    <optional>
      <ref name="cd"/>
    </optional>
    <optional>
      <ref name="name"/>
    </optional>
  </define>
  <define name="length">
    <data type="string">
      <param name="pattern">\s*((-?[0-9]*(\.[0-9]*)?(e[mx]|in|cm|mm|p[xtc]|%)?)|(negative)?((very){0,2}thi(n|ck)|medium)mathspace)\s*</param>
    </data>
  </define>
</grammar>