This repository has been archived by the owner on Sep 21, 2023. It is now read-only.
forked from dalavanmanphonsy/mathml
-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.html
679 lines (528 loc) · 33 KB
/
index.html
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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>Mathematical Markup Language (MathML) Version 4.0</title>
<script
src='https://www.w3.org/Tools/respec/respec-w3c-common'
class='remove'></script>
<script class='remove'>
var respecConfig = {
copyrightStart: 1998,
specStatus: "ED",
editors: [{
name: "David Carlisle",
company: "NAG",
url: "https://github.com/davidcarlisle",
}],
formerEditors: [{
name: "Patrick Ion"
}, {
name: "Robert Miner (deceased)"
}], edDraftURI: "https://w3c.github.io/mathml/",
shortName: "mathml",
maxTocLevel: 4,
localBiblio: {
"Pierce1961": {title: "Pierce1961"},
"Cajori1928": {title: "Cajori1928"},
"Knuth1986": {title: "Knuth1986"},
"AAP-math": {title: "AAP-math"},
"Poppelier1992": {title: "Poppelier1992"},
"ISO-12083": {title: "ISO-12083"},
"MathML1": {title: "MathML1"},
"OpenMath2004": {title: "OpenMath2004"},
"RELAX-NG": {title: "RELAX-NG"},
"XMLSchemas": {title: "XMLSchemas"},
"Namespaces": {title: "Namespaces"},
"HTML4": {title: "HTML4"},
"Entities": {title: "Entities"},
"MathMLforCSS": {title: "MathMLforCSS"},
"Chaundy1954": {title: "Chaundy1954"},
"IEEE754": {title: "IEEE754"},
"XMLSchemaDatatypes": {title: "XMLSchemaDatatypes"},
"MathMLTypes": {title: "MathMLTypes"},
"rdf": {title: "rdf"},
"OMDoc1.2": {title: "OMDoc1.2"},
"Abramowitz1977": {title: "Abramowitz1977"},
"XHTML": {title: "XHTML"},
"SVG1.1": {title: "SVG1.1"},
"XHTML-MathML-SVG": {title: "XHTML-MathML-SVG"},
"RelaxNGBook": {title: "RelaxNGBook"},
"Modularization": {title: "Modularization"},
"Normal": {title: "Normal"}
}
};
</script>
</head>
<body>
<section id='abstract'>
<p>
This specification defines the Mathematical Markup Language, or
<a id="td-mathml"></a>MathML. MathML is a markup language
for describing mathematical notation and capturing
both its structure and content. The goal of MathML is to enable
mathematics to be served, received, and processed on the World Wide
Web, just as [[HTML]] has
enabled this functionality for text.
</p>
<p>
This specification of the markup language MathML is intended
primarily for a readership consisting of those who will be
developing or implementing renderers or editors using it, or
software that will communicate using MathML as a protocol for input
or output. It is <em>not</em> a User's Guide but rather a
reference document.
</p>
<p>
MathML can be used to encode both mathematical notation and
mathematical content. About thirty-eight of the MathML tags describe
abstract notational structures, while another about one hundred and
seventy provide a way of unambiguously specifying the intended
meaning of an expression. Additional chapters discuss how the MathML
content and presentation elements interact, and how MathML renderers
might be implemented and should interact with browsers. Finally,
this document addresses the issue of special characters used for
mathematics, their handling in MathML, their presence in Unicode,
and their relation to fonts.
</p>
<p>
While MathML is human-readable, authors typically will
use equation editors, conversion
programs, and other specialized software tools to generate
MathML. Several versions of such MathML tools exist,
both freely available software and commercial
products, and more are under development.
</p>
<p>MathML was originally specified as an XML application and most of the
examples in this specification assume that syntax. Other syntaxes are possible most
notably
[[HTML5]] specifies the syntax for MathML in HTML. Unless explictly noted,
the examples in this specification are also valid HTML syntax.
</p>
</section>
<section id='sotd'>
<p><strong>This document is an editors' copy that has no official standing. (Date: 2020-10-01)</strong></p>
<p><em> This section describes the status of this document at the time
of its publication. Other documents may supersede this document. A
list of current W3C publications and the latest revision of this
technical report can be found in the <a href="https://www.w3.org/TR/">W3C technical reports index</a> at
https://www.w3.org/TR/.</em>
</p>
<p>
<em>This document is currently mostly a copy of the MathML 3 spec. It exists as a starting point for a MathML 4 spec.</em>
</p>
<p> For MathML 4, the <a href="https://www.w3.org/community/mathml4/">MathML refresh community group</a> plans to split the current MathML 3 spec into three separate documents:</p>
<ul>
<li><a href="https://mathml-refresh.github.io/mathml-core">MathML Core (Normative)</a>,</li>
<li><a href="https://mathml-refresh.github.io/mathml">MathML Full (Normative)</a>,</li>
<li><a href="https://mathml-refresh.github.io/notes-on-mathml">Notes on MathML (non-normative)</a>.</li>
</ul>
<p>MathML core is a distillation of the commonly used parts of MathML, rewritten to align with current W3C standards such as HTML and CSS. The full MathML spec maintains (mostly) backward compatibility with MathML 3. Examples of elements in MathML core include the elements for fractions, roots, scripts, limits, rows, and token elements (identifiers, numbers, operators, etc). Problematic, harder to implement, and less commonly used MathML features will make use of polyfills (likely via in part using Shadow DOM) to implement these features. Examples of features left out of MathML core but part of full MathML are <code>mfenced</code>, <code>menclose</code>, the elementary math elements, and linebreaking. Some features such as linebreaking will likely be part of a MathML Core Level 2 recommendation in the future.
</p>
<p> MathML 3 is a very lengthy spec. We expect the Full MathML 4 document to be considerably shorter because we intend to pull most of the informative sections into a notes document. Additionally, much of chapter on presentation MathML concerns layout, and the full spec will reference MathML Core for details on layout.
</p>
<p>
The changes to the MathML 3 spec have yet to be made. However, many changes are a result of the above decision to split the spec into three parts. Hence we expect MathML Full to alter the MathML 3 spec in the following ways:
</p>
<ul>
<li>Chapter 1 is mostly informative information. It will likely be shortened or eliminated, with the existing content potentially moved to a notes document.</li>
<li>Chapter 2 discusses the syntax and grammar of MathML along with the <code>math</code> element. It will likely have a similar structure to that of MathML 3. The committee is discussing adding some semantic disambiguation to presentation MathML, and a new "subject" attribute (name not finalized) might be added to give some context to the math.</li>
<li>Chapter 3 covers presentation MathML. This chapter will likely be significantly smaller. Much of the content will point to MathML core for a description of the layout and attributes allowed. There will be a general discussion of the relationship between MathML Full's presentation element and MathML Core's rules: MathML Full is meant to be used in situations outside of the web also, so we need to allow for none CSS-based rendering. The chapter will still include material about appropriate markup (what should be an mi, mo, mn, ...) along with a description of those elements not in MathML core. It will also likely include an "intent" attribute to help disambiguate meaning when the meaning of the presentation is not the default meaning in the context of the optional subject area.</li>
<li>Chapter 4 is about Content MathML. At this time, there are no plans to revise Content MathML and the chapter will likely be relatively unchanged.</li>
<li>Chapter 5 discusses mixing presentation and content markup to give meaning to presentation MathML or to give a presentation to content MathML. This is somewhat complicated and rarely used. It is informative and will move to the notes document. The MathML refresh CG feels the "subject" and "intent" attributes will likely replace this method. Those will be discussed in chapter 3. Hence, this chapter will be eliminated from the MathML Full spec.</li>
<li>Chapters 6 and 7 contain very useful informative information on interacting with HTML, XML, etc., along with usage suggestions and warnings about specific characters. Because these are informative, these two chapters will be removed from the MathML Full spec and move to the notes.</li>
<li>The MathML 3 spec has several appendices. No decisions on how they will be handled in the MathML 4 spec have been made yet.</li>
</ul>
<hr/>
<p>
<em>The remainder of this document has not been updated to MathML 4.</em>
</p>
<hr/>
<p>
This document was produced by the <a href="https://www.w3.org/Math/">W3C Math Working Group</a> as
a <a href="https://www.w3.org/Consortium/Process/tr#RecsW3C">Recommendation</a>
and is part of the
W3C <a href="https://www.w3.org/Math/Activity">Math Activity</a>.
The goals of the W3C Math Working Group are discussed in the <a href="https://www.w3.org/Math/Documents/Charter2006.html"> W3C Math WG
Charter</a> (revised July 2006). The authors of this document are
the W3C Math Working Group members. A list of <a href="appendixe.html">participants in the W3C Math Working Group</a>
is available.
</p>
<p>This document has been reviewed by W3C Members, by software
developers, and by other W3C groups and interested parties, and is
endorsed by the Director as a W3C Recommendation. It is a stable
document and may be used as reference material or cited from another
document. W3C's role in making the Recommendation is to draw attention
to the specification and to promote its widespread deployment. This
enhances the functionality and interoperability of the Web.
</p>
<p>
All reported errata to
the first edition have been addressed in this addition, and a full change log appears
in
<a href="appendixf.html">Appendix F Changes</a>. The diff-marked version linked in the frontmatter highlights all changes between
the first and second editions. In addition to incorporating errata, the main change
in this addition is to recognise that MathML parsing is also specified in <a href="appendixg.html#HTML5">[HTML5]</a> and where necessary to note where HTML and XML usage differ.
</p>
<p>
The Working Group maintains a comprehensive
<a href="https://www.w3.org/Math/testsuite/">Test Suite</a>. This
is publicly available and developers are encouraged to submit their results for display.
The <a href="https://www.w3.org/Math/testsuite/results/tests.html">Test Results</a>
are public. They show at least two interoperable implementations for each
essential test. Further details may be found in the
<a href="https://www.w3.org/Math/Documents/mml3-implementation-report.html">Implementation Report</a>.
</p>
<p>
The MathML 2.0 (Second Edition) specification has been a W3C
Recommendation since 2001. After its
recommendation, a W3C Math Interest Group collected
reports of experience
with the deployment of MathML and identified issues with MathML that
might be ameliorated. The rechartering of a Math Working Group
did not signal any change in the overall design of MathML.
The major additions in MathML 3 are support for
bidirectional layout, better linebreaking and explicit positioning,
elementary math notations, and a new strict content MathML vocabulary
with well-defined semantics. The MathML 3 Specification has also been
restructured.
</p>
<p> This document was produced by a group operating under
the <a href="https://www.w3.org/Consortium/Patent-Policy-20040205/">5 February 2004 W3C Patent Policy</a>. W3C maintains a
<a href="https://www.w3.org/2004/01/pp-impl/35549/status" rel="disclosure">public list of any patent disclosures</a> made in connection with
the deliverables of the group; that page also includes instructions
for disclosing a patent. An individual who has actual knowledge of
a patent which the individual believes contains
<a href="https://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential Claim(s)</a>
must disclose the information in accordance with
<a href="https://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the W3C Patent Policy</a>.
</p>
<p>Public discussion of MathML and issues of support through the W3C
for mathematics on the Web takes place on <a href="mailto:[email protected]"> the public mailing list of the Math Working
Group</a> (<a href="https://lists.w3.org/Archives/Public/www-math/">list archives</a>).
To subscribe send an email to <a href="mailto:[email protected]">[email protected]</a>
with the word <code>subscribe</code> in the subject line.
Alternatively, report an issue at this specification's
<a href="https://github.com/w3c/mathml">GitHub repository</a>.
</p>
<p>
The basic chapter structure of this document is based on the earlier
MathML 2.0 Recommendation <a href="appendixh.html#MathML2">[MathML2]</a>. That MathML 2.0
itself was a revision of the earlier W3C Recommendation MathML 1.01
<a href="appendixh.html#MathML1">[MathML1]</a>; MathML 3.0 is a revision of the W3C
Recommendation MathML 2.0. It differs from it in that all previous
chapters have been updated, some new
elements and attributes added and some
deprecated.
Much has been moved to separate documents containing explanatory
material, material on characters and entities and on the MathML DOM.
The discussion of character entities has led to the document
<em>XML Entity Definitions for Characters</em> <a href="appendixg.html#Entities">[Entities]</a>,
which is now a W3C Recommendation. The concern with
use of CSS with MathML has led to the document <em>A MathML for CSS Profile</em>
<a href="appendixh.html#MathMLforCSS">[MathMLforCSS]</a>, which was a W3C Recommendation
accompanying MathML 3.0.
</p>
<p>
The biggest differences from MathML 2.0 (Second Edition) are in Chapters 4 and 5,
although there have been
smaller improvements throughout the specification. A more detailed
description of changes from the previous Recommendation follows.
</p>
<ul>
<li>
<p>
Much of the non-normative explication
that formerly was found in Chapters 1 and 2, and many examples from
elsewhere in the previous MathML specifications, were removed
from the MathML3 specification and planned to be incorporated into a MathML Primer
to be prepared as a separate document. It is expected this will help
the use of this formal MathML3 specification as a reference document
in implementations, and offer the new user better help in
understanding MathML's deployment. The remaining content of Chapters 1
and 2 has been edited to reflect the changes elsewhere in the
document, and in the rapidly evolving Web environment. Some of the
text in them went back to early days of the Web and XML, and its
explanations are now commonplace.
</p>
</li>
<li>
<p>
Chapter 3, on presentation-oriented markup, adds new material on linebreaking,
and on markup for elementary math notations used in many
countries (<code>mstack</code>, <code>mlongdiv</code> and other
associated elements). Other changes include revisions to
the <code>mglyph</code>, <code>mpadded</code> and <code>maction</code>
elements and significant unification and cleanup of attribute
values.
Earlier work, as recorded in the W3C Note <a href="https://www.w3.org/TR/2006/NOTE-arabic-math-20060131/">Arabic
mathematical notation</a>, has allowed clarification of the
relationship with bidirectional text and examples
with RTL text have been added.
</p>
</li>
<li>
<p>
Chapter 4, on content-oriented markup, contains major changes and additions.
The meaning of the actual content remains as before in principle,
but a lot of work has been done on expressing it better. A few new elements have been
added.
</p>
</li>
<li>
<p>
Chapter 5 has been refined as its purpose has been further
clarified to deal with the mixing of markup languages. This chapter deals,
in particular, with interrelations of parts of the
MathML specification, especially with presentation and content
markup.
</p>
</li>
<li>
<p>
Chapter 6 is a new addition which deals with the issues of interaction
of MathML with a host environment. This chapter deals with interrelations
of the MathML specification with XML and HTML, but in the context of deployment
on the Web. In particular there is a discussion of the interaction of CSS
with MathML.
</p>
</li>
<li>
<p>
Chapter 7 replaces the previous Chapter 6, and has been rewritten
and reorganized to reflect the new
situation in regard to Unicode, and the changed
W3C context with regard to named character entities. The
new W3C specification <em>XML Entity Definitions for
Characters</em>, which incorporates those used for mathematics has
become a a W3C Recommendation, <a href="appendixg.html#Entities">[Entities]</a>.
</p>
</li>
<li>
<p>
The Appendices, of which there are eight shown, have been
reworked.
Appendix A now contains the new RelaxNG schema
for MathML3 as well as discussion of MathML3 DTD issues.
Appendix B addresses media types associated with MathML and
implicitly constitutes a request for the registration of three new ones,
as is now standard for work from the W3C.
Appendix C contains a new simplified and reconsidered Operator Dictionary.
Appendices D, E, F, G and H contain similar non-normative material to
that in the previous specification, now appropriately updated.
</p>
</li>
<li>
<p>
A fuller discussion of the document's evolution can be found in
<a href="appendixf.html">Appendix F Changes</a>.
</p>
</li>
</ul>
</section>
<section data-include="src/introduction.html" data-include-replace="true"></section>
<section data-include="src/fundamentals.html" data-include-replace="true"></section>
<section data-include="src/presentation-markup.html" data-include-replace="true"></section>
<section data-include="src/contm-new.html" data-include-replace="true"></section>
<section data-include="src/mixing.html" data-include-replace="true"></section>
<section data-include="src/world-interactions.html" data-include-replace="true"></section>
<section data-include="src/character-set.html" data-include-replace="true"></section>
<!-- respec doesn't support recusive inclusion currently-->
<section class="appendix">
<h2 id="parsing">Parsing MathML</h2>
<section data-include="src/parsing-1.html" data-include-replace="true"></section>
<section>
<h3 id="parsing_usingrnc">Using the RelaxNG Schema for Mathml4</h3>
<p>MathML documents should be validated using the RelaxNG Schema for MathML, either in
the XML encoding (<a href="http://www.w3.org/Math/RelaxNG/mathml4/mathml4.rng">http://www.w3.org/Math/RelaxNG/mathml4/mathml4.rng</a>)
or in compact notation (<a href="http://www.w3.org/Math/RelaxNG/mathml4/mathml4.rnc">http://www.w3.org/Math/RelaxNG/mathml4/mathml4.rnc</a>)
which is also shown below.</p>
<p>In contrast to DTDs there is no in-document method to associate a RelaxNG schema with
a document.</p>
<p>We provide five RelaxNG schema for Mathml4 in five parts:
</p>
<ul>
<li>
<p>The grammar for full MathML</p>
</li>
<li>
<p>The grammar for elements common to Content and Presentation</p>
</li>
<li>
<p>The grammar for Presentation MathML</p>
</li>
<li>
<p>The grammar for Strict Content MathML</p>
</li>
<li>
<p>The grammar for Content Mathml4</p>
</li>
</ul>
<section>
<h4 id="parsing_rnc_full">Full MathML</h4>
<p>The RelaxNG schema for full MathML builds on the schema describing the various parts
of the language which are given in the following sections. It can be found at <a href="http://www.w3.org/Math/RelaxNG/mathml4/mathml4.rnc">http://www.w3.org/Math/RelaxNG/mathml4/mathml4.rnc</a>.</p>
<pre data-include="src/rnc-full.html" data-include-replace="true"></pre>
</section>
<section>
<h4 id="parsing_rnc_common">Elements Common to Presentation and Content MathML</h4>
<pre data-include="src/rnc-common.html" data-include-replace="true"></pre>
</section>
<section>
<h4 id="parsing_rnc_pres">The Grammar for Presentation MathML</h4>
<pre data-include="src/rnc-pres.html" data-include-replace="true"></pre>
</section>
<section>
<h4 id="parsing_rnc_strict">The Grammar for Strict Content Mathml4</h4>
<p>The grammar for Strict Content Mathml4 can be found at <a href="http://www.w3.org/Math/RelaxNG/mathml4/mathml4-strict-content.rnc">http://www.w3.org/Math/RelaxNG/mathml4/mathml4-strict-content.rnc</a>.</p>
<pre data-include="src/rnc-strict.html" data-include-replace="true"></pre>
</section>
<section>
<h4 id="parsing_rnc_content">The Grammar for Content MathML</h4>
<p>The grammar for Content Mathml4 builds on the grammar for the Strict Content MathML
subset, and can be found at <a href="http://www.w3.org/Math/RelaxNG/mathml4/mathml4-content.rnc">http://www.w3.org/Math/RelaxNG/mathml4/mathml4-content.rnc</a>.</p>
<pre data-include="src/rnc-content.html" data-include-replace="true"></pre>
</section>
<section>
<h4 id="parsing_rnc_module">MathML as a module in a RelaxNG Schema</h4>
<p>Normally, a MathML expression does not constitute an entire XML document. MathML is
designed to be used as the mathematics fragment of larger markup languages. In
particular it is designed to be used as a <em>module</em> in documents marked up
with the XHTML family of markup languages. As RelaxNG directly supports modular
development, this is usually very easy: an XHTML+MathML schema can be specified as
simply as
<div class="example ">
<pre># A RelaxNG Schema for XHTML+MathML
include "xhtml.rnc"
math = external "mathml4.rnc"
Inline.class |= math
Block.class |= math</pre>
</div>
assuming that we have access to a modular RelaxNG schema for XHTML that uses
<code>Inline.class</code> and <code>Block.class</code> to collect the the content models
for inline and block-level elements.</p>
<p>Customizing the Mathml4 schema so that we can restrict the content of
<code class="element">annotation-xml</code> elements is similarly simple, for example:
<div class="example ">
<pre># A RelaxNG Schema for MathML with OpenMath3 annotations
omobj = external "openmath3.rnc"
include "mathml4.rnc" {anotation-xml.model = omobj}</pre>
</div>
</p>
<p>
The Mathml4 schema is organized so that subsetting to one of the sublanguages specified
here is easy.
To include strict content Mathml4 in a schema just include
<div class="example ">
<pre>include "mathml4-common.rnc"
include "mathml4-strict-content.rnc"</pre>
</div>
instead of <code>include mathml4.rnc</code>.
</p>
<p>For details about RelaxNG grammars and modularization see [[RELAX-NG]] or [[RelaxNGBook]].</p>
</section>
</section>
<section>
<h3 id="parsing_usingrnc">Using the RelaxNG Schema for Mathml4</h3>
<p>MathML documents should be validated using the RelaxNG Schema for MathML, either in
the XML encoding (<a href="http://www.w3.org/Math/RelaxNG/mathml4/mathml4.rng">http://www.w3.org/Math/RelaxNG/mathml4/mathml4.rng</a>)
or in compact notation (<a href="http://www.w3.org/Math/RelaxNG/mathml4/mathml4.rnc">http://www.w3.org/Math/RelaxNG/mathml4/mathml4.rnc</a>)
which is also shown below.</p>
<p>In contrast to DTDs there is no in-document method to associate a RelaxNG schema with
a document.</p>
<p>We provide five RelaxNG schema for Mathml4 in five parts:
</p>
<ul>
<li>
<p>The grammar for full MathML</p>
</li>
<li>
<p>The grammar for elements common to Content and Presentation</p>
</li>
<li>
<p>The grammar for Presentation MathML</p>
</li>
<li>
<p>The grammar for Strict Content MathML</p>
</li>
<li>
<p>The grammar for Content Mathml4</p>
</li>
</ul>
<section>
<h4 id="parsing_rnc_full">Full MathML</h4>
<p>The RelaxNG schema for full MathML builds on the schema describing the various parts
of the language which are given in the following sections. It can be found at <a href="http://www.w3.org/Math/RelaxNG/mathml4/mathml4.rnc">http://www.w3.org/Math/RelaxNG/mathml4/mathml4.rnc</a>.</p>
<pre data-include="src/rnc-full.html" data-include-replace="true"></pre>
</section>
<section>
<h4 id="parsing_rnc_common">Elements Common to Presentation and Content MathML</h4>
<pre data-include="src/rnc-common.html" data-include-replace="true"></pre>
</section>
<section>
<h4 id="parsing_rnc_pres">The Grammar for Presentation MathML</h4>
<pre data-include="src/rnc-pres.html" data-include-replace="true"></pre>
</section>
<section>
<h4 id="parsing_rnc_strict">The Grammar for Strict Content Mathml4</h4>
<p>The grammar for Strict Content Mathml4 can be found at <a href="http://www.w3.org/Math/RelaxNG/mathml4/mathml4-strict-content.rnc">http://www.w3.org/Math/RelaxNG/mathml4/mathml4-strict-content.rnc</a>.</p>
<pre data-include="src/rnc-strict.html" data-include-replace="true"></pre>
</section>
<section>
<h4 id="parsing_rnc_content">The Grammar for Content MathML</h4>
<p>The grammar for Content Mathml4 builds on the grammar for the Strict Content MathML
subset, and can be found at <a href="http://www.w3.org/Math/RelaxNG/mathml4/mathml4-content.rnc">http://www.w3.org/Math/RelaxNG/mathml4/mathml4-content.rnc</a>.</p>
<pre data-include="src/rnc-content.html" data-include-replace="true"></pre>
</section>
<section>
<h4 id="parsing_rnc_module">MathML as a module in a RelaxNG Schema</h4>
<p>Normally, a MathML expression does not constitute an entire XML document. MathML is
designed to be used as the mathematics fragment of larger markup languages. In
particular it is designed to be used as a <em>module</em> in documents marked up
with the XHTML family of markup languages. As RelaxNG directly supports modular
development, this is usually very easy: an XHTML+MathML schema can be specified as
simply as
<div class="example ">
<pre># A RelaxNG Schema for XHTML+MathML
include "xhtml.rnc"
math = external "mathml4.rnc"
Inline.class |= math
Block.class |= math</pre>
</div>
assuming that we have access to a modular RelaxNG schema for XHTML that uses
<code>Inline.class</code> and <code>Block.class</code> to collect the the content models
for inline and block-level elements.</p>
<p>Customizing the Mathml4 schema so that we can restrict the content of
<code class="element">annotation-xml</code> elements is similarly simple, for example:
<div class="example ">
<pre># A RelaxNG Schema for MathML with OpenMath3 annotations
omobj = external "openmath3.rnc"
include "mathml4.rnc" {anotation-xml.model = omobj}</pre>
</div>
</p>
<p>
The Mathml4 schema is organized so that subsetting to one of the sublanguages specified
here is easy.
To include strict content Mathml4 in a schema just include
<div class="example ">
<pre>include "mathml4-common.rnc"
include "mathml4-strict-content.rnc"</pre>
</div>
instead of <code>include mathml4.rnc</code>.
</p>
<p>For details about RelaxNG grammars and modularization see [[RELAX-NG]] or [[RelaxNGBook]].</p>
</section>
</section>
<section data-include="src/parsing-2.html" data-include-replace="true"></section>
</section>
<section data-include="src/media-types.html" data-include-replace="true"></section>
<section data-include="src/operator-dict.html" data-include-replace="true"></section>
<section data-include="src/glossary.html" data-include-replace="true"></section>
<section data-include="src/contributors.html" data-include-replace="true"></section>
<section data-include="src/changes.html" data-include-replace="true"></section>
<!--
<section data-include="src/references.html" data-include-replace="true"></section>
<section data-include="src/normreferences.html" data-include-replace="true"></section>
-->
</body>
</html>