mml 2.3.1 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +61 -5
  3. data/lib/mml/base/common_attributes.rb +44 -0
  4. data/lib/mml/base/content/annotation.rb +0 -2
  5. data/lib/mml/base/content/share.rb +0 -2
  6. data/lib/mml/base/math.rb +10 -4
  7. data/lib/mml/base/mfrac.rb +0 -2
  8. data/lib/mml/base/mglyph.rb +0 -2
  9. data/lib/mml/base/mi.rb +4 -6
  10. data/lib/mml/base/mlabeledtr.rb +2 -2
  11. data/lib/mml/base/mn.rb +0 -2
  12. data/lib/mml/base/mo.rb +3 -1
  13. data/lib/mml/base/ms.rb +2 -2
  14. data/lib/mml/base/mspace.rb +0 -2
  15. data/lib/mml/base/mstyle.rb +2 -2
  16. data/lib/mml/base/universal_presentation_attributes.rb +4 -0
  17. data/lib/mml/base.rb +1 -0
  18. data/lib/mml/common_elements.rb +2 -0
  19. data/lib/mml/v4/a.rb +4 -2
  20. data/lib/mml/version.rb +1 -1
  21. data/schemas/README.adoc +10 -8
  22. data/schemas/mathml4/mathml4-content.rnc +382 -0
  23. data/schemas/mathml4/mathml4-core.rnc +361 -0
  24. data/schemas/mathml4/mathml4-presentation.rnc +358 -0
  25. data/schemas/mathml4/mathml4-strict-content.rnc +86 -0
  26. data/schemas/mathml4/mathml4.rnc +21 -0
  27. data/schemas/mathml4/mathml4.rnc.1 +21 -0
  28. data/schemas/mathml4/mathml4.rng +37 -0
  29. metadata +10 -11
  30. data/schemas/mathml2/CVS/Entries +0 -4
  31. data/schemas/mathml2/CVS/Repository +0 -1
  32. data/schemas/mathml2/CVS/Root +0 -1
  33. data/schemas/mathml2/common/CVS/Entries +0 -4
  34. data/schemas/mathml2/common/CVS/Repository +0 -1
  35. data/schemas/mathml2/common/CVS/Root +0 -1
  36. data/schemas/mathml2/presentation/CVS/Entries +0 -12
  37. data/schemas/mathml2/presentation/CVS/Repository +0 -1
  38. data/schemas/mathml2/presentation/CVS/Root +0 -1
@@ -0,0 +1,361 @@
1
+ # MathML 4 (Core Level 1)
2
+ # #######################
3
+
4
+ # Copyright 1998-2024 W3C (MIT, ERCIM, Keio, Beihang)
5
+ #
6
+ # Use and distribution of this code are permitted under the terms
7
+ # W3C Software Notice and License
8
+ # http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
9
+
10
+ default namespace m = "http://www.w3.org/1998/Math/MathML"
11
+ namespace h = "http://www.w3.org/1999/xhtml"
12
+
13
+ start |= math
14
+
15
+ math = element math {math.attributes,ImpliedMrow}
16
+
17
+ MathMLoneventAttributes =
18
+ attribute onabort {text}?,
19
+ attribute onauxclick {text}?,
20
+ attribute onblur {text}?,
21
+ attribute oncancel {text}?,
22
+ attribute oncanplay {text}?,
23
+ attribute oncanplaythrough {text}?,
24
+ attribute onchange {text}?,
25
+ attribute onclick {text}?,
26
+ attribute onclose {text}?,
27
+ attribute oncontextlost {text}?,
28
+ attribute oncontextmenu {text}?,
29
+ attribute oncontextrestored {text}?,
30
+ attribute oncuechange {text}?,
31
+ attribute ondblclick {text}?,
32
+ attribute ondrag {text}?,
33
+ attribute ondragend {text}?,
34
+ attribute ondragenter {text}?,
35
+ attribute ondragleave {text}?,
36
+ attribute ondragover {text}?,
37
+ attribute ondragstart {text}?,
38
+ attribute ondrop {text}?,
39
+ attribute ondurationchange {text}?,
40
+ attribute onemptied {text}?,
41
+ attribute onended {text}?,
42
+ attribute onerror {text}?,
43
+ attribute onfocus {text}?,
44
+ attribute onformdata {text}?,
45
+ attribute oninput {text}?,
46
+ attribute oninvalid {text}?,
47
+ attribute onkeydown {text}?,
48
+ attribute onkeypress {text}?,
49
+ attribute onkeyup {text}?,
50
+ attribute onload {text}?,
51
+ attribute onloadeddata {text}?,
52
+ attribute onloadedmetadata {text}?,
53
+ attribute onloadstart {text}?,
54
+ attribute onmousedown {text}?,
55
+ attribute onmouseenter {text}?,
56
+ attribute onmouseleave {text}?,
57
+ attribute onmousemove {text}?,
58
+ attribute onmouseout {text}?,
59
+ attribute onmouseover {text}?,
60
+ attribute onmouseup {text}?,
61
+ attribute onpause {text}?,
62
+ attribute onplay {text}?,
63
+ attribute onplaying {text}?,
64
+ attribute onprogress {text}?,
65
+ attribute onratechange {text}?,
66
+ attribute onreset {text}?,
67
+ attribute onresize {text}?,
68
+ attribute onscroll {text}?,
69
+ attribute onsecuritypolicyviolation {text}?,
70
+ attribute onseeked {text}?,
71
+ attribute onseeking {text}?,
72
+ attribute onselect {text}?,
73
+ attribute onslotchange {text}?,
74
+ attribute onstalled {text}?,
75
+ attribute onsubmit {text}?,
76
+ attribute onsuspend {text}?,
77
+ attribute ontimeupdate {text}?,
78
+ attribute ontoggle {text}?,
79
+ attribute onvolumechange {text}?,
80
+ attribute onwaiting {text}?,
81
+ attribute onwebkitanimationend {text}?,
82
+ attribute onwebkitanimationiteration {text}?,
83
+ attribute onwebkitanimationstart {text}?,
84
+ attribute onwebkittransitionend {text}?,
85
+ attribute onwheel {text}?,
86
+ attribute onafterprint {text}?,
87
+ attribute onbeforeprint {text}?,
88
+ attribute onbeforeunload {text}?,
89
+ attribute onhashchange {text}?,
90
+ attribute onlanguagechange {text}?,
91
+ attribute onmessage {text}?,
92
+ attribute onmessageerror {text}?,
93
+ attribute onoffline {text}?,
94
+ attribute ononline {text}?,
95
+ attribute onpagehide {text}?,
96
+ attribute onpageshow {text}?,
97
+ attribute onpopstate {text}?,
98
+ attribute onrejectionhandled {text}?,
99
+ attribute onstorage {text}?,
100
+ attribute onunhandledrejection {text}?,
101
+ attribute onunload {text}?,
102
+ attribute oncopy {text}?,
103
+ attribute oncut {text}?,
104
+ attribute onpaste {text}?
105
+
106
+ MathMLlink.attributes=
107
+ attribute attributionsrc {text}?,
108
+ attribute download {mathml-boolean}?,
109
+ attribute filename {text}?,
110
+ attribute href {text}?,
111
+ attribute hreflang {text}?,
112
+ attribute referrerpolicy {text}?,
113
+ attribute rel {text}?,
114
+ attribute target {text}?,
115
+ attribute type {text}?
116
+
117
+
118
+
119
+ # Sample set. May need preprocessing
120
+ # or schema extension to allow more see MathML Core (and HTML) spec
121
+ MathMLDataAttributes =
122
+ attribute data-other {text}?
123
+
124
+
125
+ # sample set, like data- may need preprocessing to allow more
126
+ MathMLARIAattributes =
127
+ attribute aria-label {text}?,
128
+ attribute aria-describedby {text}?,
129
+ attribute aria-description {text}?,
130
+ attribute aria-details {text}?
131
+
132
+ MathMLintentAttributes =
133
+ attribute intent {text}?,
134
+ attribute arg {xsd:NCName}?
135
+
136
+ MathMLPGlobalAttributes = attribute id {xsd:ID}?,
137
+ attribute class {xsd:NCName}?,
138
+ attribute style {xsd:string}?,
139
+ attribute dir {"ltr" | "rtl"}?,
140
+ attribute mathbackground {color}?,
141
+ attribute mathcolor {color}?,
142
+ attribute mathsize {length-percentage}?,
143
+ attribute mathvariant {xsd:string{pattern="\s*([Nn][Oo][Rr][Mm][Aa][Ll]|[Bb][Oo][Ll][Dd]|[Ii][Tt][Aa][Ll][Ii][Cc]|[Bb][Oo][Ll][Dd]-[Ii][Tt][Aa][Ll][Ii][Cc]|[Dd][Oo][Uu][Bb][Ll][Ee]-[Ss][Tt][Rr][Uu][Cc][Kk]|[Bb][Oo][Ll][Dd]-[Ff][Rr][Aa][Kk][Tt][Uu][Rr]|[Ss][Cc][Rr][Ii][Pp][Tt]|[Bb][Oo][Ll][Dd]-[Ss][Cc][Rr][Ii][Pp][Tt]|[Ff][Rr][Aa][Kk][Tt][Uu][Rr]|[Ss][Aa][Nn][Ss]-[Ss][Ee][Rr][Ii][Ff]|[Bb][Oo][Ll][Dd]-[Ss][Aa][Nn][Ss]-[Ss][Ee][Rr][Ii][Ff]|[Ss][Aa][Nn][Ss]-[Ss][Ee][Rr][Ii][Ff]-[Ii][Tt][Aa][Ll][Ii][Cc]|[Ss][Aa][Nn][Ss]-[Ss][Ee][Rr][Ii][Ff]-[Bb][Oo][Ll][Dd]-[Ii][Tt][Aa][Ll][Ii][Cc]|[Mm][Oo][Nn][Oo][Ss][Pp][Aa][Cc][Ee]|[Ii][Nn][Ii][Tt][Ii][Aa][Ll]|[Tt][Aa][Ii][Ll][Ee][Dd]|[Ll][Oo][Oo][Pp][Ee][Dd]|[Ss][Tt][Rr][Ee][Tt][Cc][Hh][Ee][Dd])\s*"}}?,
144
+ attribute displaystyle {mathml-boolean}?,
145
+ attribute scriptlevel {xsd:integer}?,
146
+ attribute autofocus {mathml-boolean}?,
147
+ attribute tabindex {xsd:integer}?,
148
+ attribute nonce {text}?,
149
+ MathMLoneventAttributes,
150
+ # Extension attributes, no defined behavior
151
+ MathMLDataAttributes,
152
+ # No specified behavior in Core, see MathML4
153
+ MathMLintentAttributes,
154
+ # No specified behavior in Core, see WAI-ARIA
155
+ MathMLARIAattributes
156
+
157
+
158
+
159
+ math.attributes = MathMLPGlobalAttributes,
160
+ attribute display {"block" | "inline"}?,
161
+ # No specified behavior in Core, see MathML4
162
+ attribute alttext {text}?
163
+
164
+
165
+ annotation = element annotation {MathMLPGlobalAttributes,encoding?,text}
166
+
167
+ anyElement = element (*) {(attribute * {text}|text| anyElement)*}
168
+
169
+ annotation-xml = element annotation-xml {annotation-xml.attributes,
170
+ (MathExpression*|anyElement*)}
171
+
172
+ annotation-xml.attributes = MathMLPGlobalAttributes, encoding?
173
+
174
+ encoding=attribute encoding {xsd:string}?
175
+
176
+
177
+ semantics = element semantics {semantics.attributes,
178
+ MathExpression,
179
+ (annotation|annotation-xml)*}
180
+
181
+ semantics.attributes = MathMLPGlobalAttributes
182
+
183
+ mathml-boolean = xsd:string {
184
+ pattern = '\s*([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])\s*'
185
+ }
186
+
187
+ length-percentage = xsd:string {
188
+ pattern = '\s*((-?[0-9]*([0-9]\.?|\.[0-9])[0-9]*(r?em|ex|in|cm|mm|p[xtc]|Q|v[hw]|vmin|vmax|%))|0)\s*'
189
+ }
190
+
191
+ MathExpression = TokenExpression|
192
+ mrow|a|mfrac|msqrt|mroot|mstyle|merror|mpadded|mphantom|
193
+ msub|msup|msubsup|munder|mover|munderover|
194
+ mmultiscripts|mtable|maction|
195
+ semantics
196
+
197
+ MathMalignExpression = MathExpression
198
+
199
+ ImpliedMrow = MathMalignExpression*
200
+
201
+ TableRowExpression = mtr
202
+
203
+ MultiScriptExpression = (MathExpression|none),(MathExpression|none)
204
+
205
+
206
+ color = xsd:string {
207
+ pattern = '\s*((#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?)|[a-zA-Z]+|[a-zA-Z]+\s*\([0-9, %.]+\))\s*'}
208
+
209
+ TokenExpression = mi|mn|mo|mtext|mspace|ms
210
+
211
+
212
+ textorHTML = text | element (h:*) {attribute * {text}*,textorHTML*}
213
+
214
+ token.content = textorHTML
215
+
216
+ mi = element mi {mi.attributes, token.content}
217
+ mi.attributes =
218
+ MathMLPGlobalAttributes
219
+
220
+ mn = element mn {mn.attributes, token.content}
221
+ mn.attributes =
222
+ MathMLPGlobalAttributes
223
+
224
+ mo = element mo {mo.attributes, token.content}
225
+ mo.attributes =
226
+ MathMLPGlobalAttributes,
227
+ attribute form {"prefix" | "infix" | "postfix"}?,
228
+ attribute lspace {length-percentage}?,
229
+ attribute rspace {length-percentage}?,
230
+ attribute stretchy {mathml-boolean}?,
231
+ attribute symmetric {mathml-boolean}?,
232
+ attribute maxsize {length-percentage}?,
233
+ attribute minsize {length-percentage}?,
234
+ attribute largeop {mathml-boolean}?,
235
+ attribute movablelimits {mathml-boolean}?
236
+
237
+
238
+ mtext = element mtext {mtext.attributes, token.content}
239
+ mtext.attributes =
240
+ MathMLPGlobalAttributes
241
+
242
+ mspace = element mspace {mspace.attributes, empty}
243
+ mspace.attributes =
244
+ MathMLPGlobalAttributes,
245
+ attribute width {length-percentage}?,
246
+ attribute height {length-percentage}?,
247
+ attribute depth {length-percentage}?
248
+
249
+ ms = element ms {ms.attributes, token.content}
250
+ ms.attributes =
251
+ MathMLPGlobalAttributes
252
+
253
+
254
+ none = element none {none.attributes,empty}
255
+ none.attributes =
256
+ MathMLPGlobalAttributes
257
+
258
+ mprescripts = element mprescripts {mprescripts.attributes,empty}
259
+ mprescripts.attributes =
260
+ MathMLPGlobalAttributes
261
+
262
+ mrow = element mrow {mrow.attributes, ImpliedMrow}
263
+ mrow.attributes =
264
+ MathMLPGlobalAttributes
265
+
266
+ a = element a {mrow.attributes, MathMLlink.attributes, ImpliedMrow}
267
+
268
+ mfrac = element mfrac {mfrac.attributes, MathExpression, MathExpression}
269
+ mfrac.attributes =
270
+ MathMLPGlobalAttributes,
271
+ attribute linethickness {length-percentage}?
272
+
273
+ msqrt = element msqrt {msqrt.attributes, ImpliedMrow}
274
+ msqrt.attributes =
275
+ MathMLPGlobalAttributes
276
+
277
+ mroot = element mroot {mroot.attributes, MathExpression, MathExpression}
278
+ mroot.attributes =
279
+ MathMLPGlobalAttributes
280
+
281
+ mstyle = element mstyle {mstyle.attributes, ImpliedMrow}
282
+ mstyle.attributes =
283
+ MathMLPGlobalAttributes
284
+
285
+ merror = element merror {merror.attributes, ImpliedMrow}
286
+ merror.attributes =
287
+ MathMLPGlobalAttributes
288
+
289
+ mpadded = element mpadded {mpadded.attributes, ImpliedMrow}
290
+ mpadded.attributes =
291
+ MathMLPGlobalAttributes,
292
+ attribute height {mpadded-length-percentage}?,
293
+ attribute depth {mpadded-length-percentage}?,
294
+ attribute width {mpadded-length-percentage}?,
295
+ attribute lspace {mpadded-length-percentage}?,
296
+ attribute rspace {mpadded-length-percentage}?,
297
+ attribute voffset {mpadded-length-percentage}?
298
+
299
+ mpadded-length-percentage=length-percentage
300
+
301
+ mphantom = element mphantom {mphantom.attributes, ImpliedMrow}
302
+ mphantom.attributes =
303
+ MathMLPGlobalAttributes
304
+
305
+
306
+ msub = element msub {msub.attributes, MathExpression, MathExpression}
307
+ msub.attributes =
308
+ MathMLPGlobalAttributes
309
+
310
+ msup = element msup {msup.attributes, MathExpression, MathExpression}
311
+ msup.attributes =
312
+ MathMLPGlobalAttributes
313
+
314
+ msubsup = element msubsup {msubsup.attributes, MathExpression, MathExpression, MathExpression}
315
+ msubsup.attributes =
316
+ MathMLPGlobalAttributes
317
+
318
+ munder = element munder {munder.attributes, MathExpression, MathExpression}
319
+ munder.attributes =
320
+ MathMLPGlobalAttributes,
321
+ attribute accentunder {mathml-boolean}?
322
+
323
+ mover = element mover {mover.attributes, MathExpression, MathExpression}
324
+ mover.attributes =
325
+ MathMLPGlobalAttributes,
326
+ attribute accent {mathml-boolean}?
327
+
328
+ munderover = element munderover {munderover.attributes, MathExpression, MathExpression, MathExpression}
329
+ munderover.attributes =
330
+ MathMLPGlobalAttributes,
331
+ attribute accent {mathml-boolean}?,
332
+ attribute accentunder {mathml-boolean}?
333
+
334
+ mmultiscripts = element mmultiscripts {mmultiscripts.attributes,
335
+ MathExpression,
336
+ MultiScriptExpression*,
337
+ (mprescripts,MultiScriptExpression*)?}
338
+ mmultiscripts.attributes =
339
+ msubsup.attributes
340
+
341
+ mtable = element mtable {mtable.attributes, TableRowExpression*}
342
+ mtable.attributes =
343
+ MathMLPGlobalAttributes
344
+
345
+
346
+ mtr = element mtr {mtr.attributes, mtd*}
347
+ mtr.attributes =
348
+ MathMLPGlobalAttributes
349
+
350
+ mtd = element mtd {mtd.attributes, ImpliedMrow}
351
+ mtd.attributes =
352
+ MathMLPGlobalAttributes,
353
+ attribute rowspan {xsd:positiveInteger}?,
354
+ attribute columnspan {xsd:positiveInteger}?
355
+
356
+
357
+ maction = element maction {maction.attributes, ImpliedMrow}
358
+ maction.attributes =
359
+ MathMLPGlobalAttributes,
360
+ attribute actiontype {text}?,
361
+ attribute selection {xsd:positiveInteger}?