mml 2.3.0 → 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.
- checksums.yaml +4 -4
- data/.gitmodules +9 -0
- data/.rubocop.yml +4 -0
- data/.rubocop_todo.yml +83 -18
- data/Gemfile +0 -2
- data/README.adoc +176 -47
- data/Rakefile +16 -1
- data/lib/mml/base/common_attributes.rb +44 -0
- data/lib/mml/base/content/annotation.rb +28 -0
- data/lib/mml/base/content/annotation_xml.rb +31 -0
- data/lib/mml/base/content/apply.rb +27 -0
- data/lib/mml/base/content/arith.rb +243 -0
- data/lib/mml/base/content/bind.rb +27 -0
- data/lib/mml/base/content/bvar.rb +20 -0
- data/lib/mml/base/content/calculus.rb +103 -0
- data/lib/mml/base/content/cbytes.rb +24 -0
- data/lib/mml/base/content/cerror.rb +24 -0
- data/lib/mml/base/content/ci.rb +77 -0
- data/lib/mml/base/content/cn.rb +33 -0
- data/lib/mml/base/content/condition.rb +20 -0
- data/lib/mml/base/content/constants.rb +173 -0
- data/lib/mml/base/content/cs.rb +22 -0
- data/lib/mml/base/content/csymbol.rb +79 -0
- data/lib/mml/base/content/declare.rb +34 -0
- data/lib/mml/base/content/degree.rb +20 -0
- data/lib/mml/base/content/elementary_functions.rb +309 -0
- data/lib/mml/base/content/fn.rb +25 -0
- data/lib/mml/base/content/functions.rb +85 -0
- data/lib/mml/base/content/interval.rb +24 -0
- data/lib/mml/base/content/inverse.rb +25 -0
- data/lib/mml/base/content/lambda.rb +20 -0
- data/lib/mml/base/content/linear_algebra.rb +122 -0
- data/lib/mml/base/content/logic.rb +93 -0
- data/lib/mml/base/content/otherwise.rb +20 -0
- data/lib/mml/base/content/piece.rb +20 -0
- data/lib/mml/base/content/piecewise.rb +20 -0
- data/lib/mml/base/content/relations.rb +113 -0
- data/lib/mml/base/content/reln.rb +19 -0
- data/lib/mml/base/content/semantics.rb +27 -0
- data/lib/mml/base/content/sep.rb +19 -0
- data/lib/mml/base/content/sets.rb +163 -0
- data/lib/mml/base/content/share.rb +22 -0
- data/lib/mml/base/content/statistics.rb +95 -0
- data/lib/mml/base/content/vector_calculus.rb +63 -0
- data/lib/mml/base/content_loader.rb +195 -0
- data/lib/mml/base/maction.rb +1 -0
- data/lib/mml/base/math.rb +47 -0
- data/lib/mml/base/menclose.rb +1 -1
- data/lib/mml/base/mfenced.rb +2 -2
- data/lib/mml/base/mglyph.rb +2 -2
- data/lib/mml/base/mi.rb +9 -6
- data/lib/mml/base/mlabeledtr.rb +2 -6
- data/lib/mml/base/mn.rb +3 -2
- data/lib/mml/base/mo.rb +3 -3
- data/lib/mml/base/mrow.rb +0 -2
- data/lib/mml/base/ms.rb +4 -6
- data/lib/mml/base/mscarries.rb +1 -1
- data/lib/mml/base/mspace.rb +0 -2
- data/lib/mml/base/mstyle.rb +4 -8
- data/lib/mml/base/mtable.rb +8 -0
- data/lib/mml/base/mtd.rb +6 -0
- data/lib/mml/base/mtext.rb +0 -2
- data/lib/mml/base/semantics.rb +4 -2
- data/lib/mml/base/universal_presentation_attributes.rb +46 -0
- data/lib/mml/base/v3_common.rb +16 -0
- data/lib/mml/base/v3_presentation_attributes.rb +15 -0
- data/lib/mml/base/v4_attributes.rb +4 -18
- data/lib/mml/base.rb +11 -0
- data/lib/mml/common_elements.rb +336 -0
- data/lib/mml/context_configuration.rb +29 -0
- data/lib/mml/v2/annotation.rb +9 -0
- data/lib/mml/v2/annotation_xml.rb +9 -0
- data/lib/mml/v2/apply.rb +9 -0
- data/lib/mml/v2/arith.rb +93 -0
- data/lib/mml/v2/bind.rb +9 -0
- data/lib/mml/v2/bvar.rb +9 -0
- data/lib/mml/v2/calculus.rb +33 -0
- data/lib/mml/v2/ci.rb +9 -0
- data/lib/mml/v2/cn.rb +9 -0
- data/lib/mml/v2/common_elements.rb +34 -0
- data/lib/mml/v2/condition.rb +9 -0
- data/lib/mml/v2/configuration.rb +13 -0
- data/lib/mml/v2/constants.rb +65 -0
- data/lib/mml/v2/csymbol.rb +9 -0
- data/lib/mml/v2/degree.rb +9 -0
- data/lib/mml/v2/elementary_functions.rb +121 -0
- data/lib/mml/v2/fn.rb +9 -0
- data/lib/mml/v2/functions.rb +29 -0
- data/lib/mml/v2/interval.rb +9 -0
- data/lib/mml/v2/inverse.rb +9 -0
- data/lib/mml/v2/lambda.rb +9 -0
- data/lib/mml/v2/linear_algebra.rb +41 -0
- data/lib/mml/v2/logic.rb +33 -0
- data/lib/mml/v2/maction.rb +9 -0
- data/lib/mml/v2/maligngroup.rb +9 -0
- data/lib/mml/v2/malignmark.rb +9 -0
- data/lib/mml/v2/math.rb +11 -0
- data/lib/mml/v2/menclose.rb +9 -0
- data/lib/mml/v2/merror.rb +9 -0
- data/lib/mml/v2/mfenced.rb +9 -0
- data/lib/mml/v2/mfrac.rb +9 -0
- data/lib/mml/v2/mfraction.rb +9 -0
- data/lib/mml/v2/mglyph.rb +9 -0
- data/lib/mml/v2/mi.rb +9 -0
- data/lib/mml/v2/mlabeledtr.rb +9 -0
- data/lib/mml/v2/mlongdiv.rb +9 -0
- data/lib/mml/v2/mmultiscripts.rb +9 -0
- data/lib/mml/v2/mn.rb +9 -0
- data/lib/mml/v2/mo.rb +10 -0
- data/lib/mml/v2/mover.rb +9 -0
- data/lib/mml/v2/mpadded.rb +9 -0
- data/lib/mml/v2/mphantom.rb +9 -0
- data/lib/mml/v2/mprescripts.rb +9 -0
- data/lib/mml/v2/mroot.rb +9 -0
- data/lib/mml/v2/mrow.rb +9 -0
- data/lib/mml/v2/ms.rb +9 -0
- data/lib/mml/v2/mscarries.rb +9 -0
- data/lib/mml/v2/mscarry.rb +9 -0
- data/lib/mml/v2/msgroup.rb +9 -0
- data/lib/mml/v2/msline.rb +9 -0
- data/lib/mml/v2/mspace.rb +9 -0
- data/lib/mml/v2/msqrt.rb +9 -0
- data/lib/mml/v2/msrow.rb +9 -0
- data/lib/mml/v2/mstack.rb +9 -0
- data/lib/mml/v2/mstyle.rb +10 -0
- data/lib/mml/v2/msub.rb +9 -0
- data/lib/mml/v2/msubsup.rb +9 -0
- data/lib/mml/v2/msup.rb +9 -0
- data/lib/mml/v2/mtable.rb +9 -0
- data/lib/mml/v2/mtd.rb +9 -0
- data/lib/mml/v2/mtext.rb +9 -0
- data/lib/mml/v2/mtr.rb +9 -0
- data/lib/mml/v2/munder.rb +9 -0
- data/lib/mml/v2/munderover.rb +9 -0
- data/lib/mml/v2/namespace.rb +7 -0
- data/lib/mml/v2/none.rb +9 -0
- data/lib/mml/v2/otherwise.rb +9 -0
- data/lib/mml/v2/piece.rb +9 -0
- data/lib/mml/v2/piecewise.rb +9 -0
- data/lib/mml/v2/relations.rb +41 -0
- data/lib/mml/v2/reln.rb +13 -0
- data/lib/mml/v2/semantics.rb +9 -0
- data/lib/mml/v2/sep.rb +9 -0
- data/lib/mml/v2/sets.rb +57 -0
- data/lib/mml/v2/statistics.rb +33 -0
- data/lib/mml/v2/vector_calculus.rb +21 -0
- data/lib/mml/v2.rb +311 -0
- data/lib/mml/v3/annotation.rb +10 -0
- data/lib/mml/v3/annotation_xml.rb +10 -0
- data/lib/mml/v3/apply.rb +10 -0
- data/lib/mml/v3/arith.rb +115 -0
- data/lib/mml/v3/bind.rb +10 -0
- data/lib/mml/v3/calculus.rb +40 -0
- data/lib/mml/v3/cbytes.rb +10 -0
- data/lib/mml/v3/cerror.rb +10 -0
- data/lib/mml/v3/ci.rb +10 -0
- data/lib/mml/v3/cn.rb +10 -0
- data/lib/mml/v3/common_elements.rb +34 -0
- data/lib/mml/v3/constants.rb +80 -0
- data/lib/mml/v3/constructs.rb +55 -0
- data/lib/mml/v3/cs.rb +10 -0
- data/lib/mml/v3/csymbol.rb +10 -0
- data/lib/mml/v3/deprecated_content.rb +29 -0
- data/lib/mml/v3/elementary_functions.rb +145 -0
- data/lib/mml/v3/functions.rb +35 -0
- data/lib/mml/v3/linear_algebra.rb +50 -0
- data/lib/mml/v3/logic.rb +40 -0
- data/lib/mml/v3/maction.rb +1 -1
- data/lib/mml/v3/math.rb +7 -1
- data/lib/mml/v3/mi.rb +1 -0
- data/lib/mml/v3/mn.rb +1 -0
- data/lib/mml/v3/mo.rb +1 -0
- data/lib/mml/v3/mrow.rb +1 -0
- data/lib/mml/v3/ms.rb +1 -0
- data/lib/mml/v3/mstyle.rb +1 -0
- data/lib/mml/v3/mtext.rb +1 -0
- data/lib/mml/v3/relations.rb +50 -0
- data/lib/mml/v3/sets.rb +70 -0
- data/lib/mml/v3/statistics.rb +40 -0
- data/lib/mml/v3/vector_calculus.rb +25 -0
- data/lib/mml/v3.rb +25 -0
- data/lib/mml/v4/a.rb +4 -3
- data/lib/mml/v4/annotation.rb +10 -0
- data/lib/mml/v4/annotation_xml.rb +14 -0
- data/lib/mml/v4/apply.rb +9 -0
- data/lib/mml/v4/arith.rb +93 -0
- data/lib/mml/v4/calculus.rb +25 -0
- data/lib/mml/v4/cbytes.rb +9 -0
- data/lib/mml/v4/cerror.rb +9 -0
- data/lib/mml/v4/ci.rb +9 -0
- data/lib/mml/v4/cn.rb +9 -0
- data/lib/mml/v4/common_elements.rb +33 -0
- data/lib/mml/v4/constants.rb +65 -0
- data/lib/mml/v4/constructs.rb +49 -0
- data/lib/mml/v4/cs.rb +9 -0
- data/lib/mml/v4/csymbol.rb +9 -0
- data/lib/mml/v4/deprecated_content.rb +25 -0
- data/lib/mml/v4/elementary_functions.rb +118 -0
- data/lib/mml/v4/factorof.rb +9 -0
- data/lib/mml/v4/functions.rb +30 -0
- data/lib/mml/v4/limit.rb +9 -0
- data/lib/mml/v4/linear_algebra.rb +41 -0
- data/lib/mml/v4/logic.rb +33 -0
- data/lib/mml/v4/maction.rb +1 -2
- data/lib/mml/v4/maligngroup.rb +0 -1
- data/lib/mml/v4/malignmark.rb +0 -1
- data/lib/mml/v4/math.rb +1 -1
- data/lib/mml/v4/menclose.rb +0 -1
- data/lib/mml/v4/merror.rb +0 -1
- data/lib/mml/v4/mfenced.rb +0 -1
- data/lib/mml/v4/mfrac.rb +0 -1
- data/lib/mml/v4/mfraction.rb +0 -1
- data/lib/mml/v4/mglyph.rb +0 -1
- data/lib/mml/v4/mi.rb +1 -1
- data/lib/mml/v4/mlabeledtr.rb +0 -1
- data/lib/mml/v4/mlongdiv.rb +0 -1
- data/lib/mml/v4/mmultiscripts.rb +0 -1
- data/lib/mml/v4/mn.rb +1 -1
- data/lib/mml/v4/mo.rb +1 -1
- data/lib/mml/v4/mover.rb +0 -1
- data/lib/mml/v4/mpadded.rb +0 -1
- data/lib/mml/v4/mphantom.rb +0 -1
- data/lib/mml/v4/mprescripts.rb +0 -1
- data/lib/mml/v4/mroot.rb +0 -1
- data/lib/mml/v4/mrow.rb +1 -1
- data/lib/mml/v4/ms.rb +1 -1
- data/lib/mml/v4/mscarries.rb +0 -1
- data/lib/mml/v4/mscarry.rb +0 -1
- data/lib/mml/v4/msgroup.rb +0 -1
- data/lib/mml/v4/msline.rb +0 -1
- data/lib/mml/v4/mspace.rb +0 -1
- data/lib/mml/v4/msqrt.rb +0 -1
- data/lib/mml/v4/msrow.rb +0 -1
- data/lib/mml/v4/mstack.rb +0 -1
- data/lib/mml/v4/mstyle.rb +1 -1
- data/lib/mml/v4/msub.rb +0 -1
- data/lib/mml/v4/msubsup.rb +0 -1
- data/lib/mml/v4/msup.rb +0 -1
- data/lib/mml/v4/mtable.rb +0 -1
- data/lib/mml/v4/mtd.rb +0 -1
- data/lib/mml/v4/mtext.rb +1 -1
- data/lib/mml/v4/mtr.rb +0 -1
- data/lib/mml/v4/munder.rb +0 -1
- data/lib/mml/v4/munderover.rb +0 -1
- data/lib/mml/v4/none.rb +0 -1
- data/lib/mml/v4/relations.rb +37 -0
- data/lib/mml/v4/semantics.rb +0 -1
- data/lib/mml/v4/sets.rb +57 -0
- data/lib/mml/v4/statistics.rb +33 -0
- data/lib/mml/v4/tendsto.rb +9 -0
- data/lib/mml/v4/vector_calculus.rb +21 -0
- data/lib/mml/v4.rb +421 -44
- data/lib/mml/version.rb +1 -1
- data/lib/mml/versioned_parser.rb +1 -1
- data/lib/mml.rb +3 -1
- data/reference-docs/mathml-source/pubtext/mathmlspec.dtd +150 -0
- data/reference-docs/mathml-source/pubtext/xmlspec.dtd +2649 -0
- data/reference-docs/mathml-source/readme.txt +40 -0
- data/reference-docs/mathml-source/run +296 -0
- data/reference-docs/mathml-source/style/html/html2xhtml.xsl +216 -0
- data/reference-docs/mathml-source/style/html/images.xsl +98 -0
- data/reference-docs/mathml-source/style/html/mml6.xsl +1156 -0
- data/reference-docs/mathml-source/style/html/mmldiff.xsl +566 -0
- data/reference-docs/mathml-source/style/html/mmlspec.xsl +2531 -0
- data/reference-docs/mathml-source/style/html/slices-common.xsl +312 -0
- data/reference-docs/mathml-source/style/html/slices.xsl +48 -0
- data/reference-docs/mathml-source/style/html/xmlspec.xsl +2542 -0
- data/reference-docs/mathml-source/style/pdf/mathmlspec.xsl +2510 -0
- data/reference-docs/mathml-source/xml/changes.xml +773 -0
- data/reference-docs/mathml-source/xml/character-set.xml +1011 -0
- data/reference-docs/mathml-source/xml/content-element-def.xml +6143 -0
- data/reference-docs/mathml-source/xml/content-markup.xml +8178 -0
- data/reference-docs/mathml-source/xml/contributors.xml +425 -0
- data/reference-docs/mathml-source/xml/dom-bindings.xml +20 -0
- data/reference-docs/mathml-source/xml/dom-intro.xml +114 -0
- data/reference-docs/mathml-source/xml/fundamentals.xml +1646 -0
- data/reference-docs/mathml-source/xml/glossary.xml +519 -0
- data/reference-docs/mathml-source/xml/interface.xml +1096 -0
- data/reference-docs/mathml-source/xml/introduction.xml +724 -0
- data/reference-docs/mathml-source/xml/mathml-css-sample.xml +304 -0
- data/reference-docs/mathml-source/xml/mathml-dom.xml +3813 -0
- data/reference-docs/mathml-source/xml/mathml-spec.xml +356 -0
- data/reference-docs/mathml-source/xml/mixing.xml +982 -0
- data/reference-docs/mathml-source/xml/operator-dict.xml +551 -0
- data/reference-docs/mathml-source/xml/parsing.xml +2565 -0
- data/reference-docs/mathml-source/xml/presentation-markup.xml +6834 -0
- data/reference-docs/mathml-source/xml/references.xml +323 -0
- data/reference-docs/mathml-source/xml/validation-grammar.xml +877 -0
- data/schemas/README.adoc +17 -0
- data/schemas/mathml2/common/common-attribs.xsd +41 -0
- data/schemas/mathml2/common/math.xsd +126 -0
- data/schemas/mathml2/common/xlink-href.xsd +20 -0
- data/schemas/mathml2/content/CVS/Entries +16 -0
- data/schemas/mathml2/content/CVS/Repository +1 -0
- data/schemas/mathml2/content/CVS/Root +1 -0
- data/schemas/mathml2/content/arith.xsd +90 -0
- data/schemas/mathml2/content/calculus.xsd +146 -0
- data/schemas/mathml2/content/common-attrib.xsd +30 -0
- data/schemas/mathml2/content/constants.xsd +83 -0
- data/schemas/mathml2/content/constructs.xsd +260 -0
- data/schemas/mathml2/content/elementary-functions.xsd +117 -0
- data/schemas/mathml2/content/functions.xsd +73 -0
- data/schemas/mathml2/content/linear-algebra.xsd +173 -0
- data/schemas/mathml2/content/logic.xsd +53 -0
- data/schemas/mathml2/content/relations.xsd +55 -0
- data/schemas/mathml2/content/semantics.xsd +85 -0
- data/schemas/mathml2/content/sets.xsd +236 -0
- data/schemas/mathml2/content/statistics.xsd +136 -0
- data/schemas/mathml2/content/tokens.xsd +120 -0
- data/schemas/mathml2/content/tokens.xsd.~1.3.~ +119 -0
- data/schemas/mathml2/content/vector-calculus.xsd +88 -0
- data/schemas/mathml2/mathml2.xsd +59 -0
- data/schemas/mathml2/presentation/action.xsd +44 -0
- data/schemas/mathml2/presentation/characters.xsd +37 -0
- data/schemas/mathml2/presentation/common-attribs.xsd +113 -0
- data/schemas/mathml2/presentation/common-types.xsd +103 -0
- data/schemas/mathml2/presentation/error.xsd +40 -0
- data/schemas/mathml2/presentation/layout.xsd +195 -0
- data/schemas/mathml2/presentation/scripts.xsd +186 -0
- data/schemas/mathml2/presentation/space.xsd +52 -0
- data/schemas/mathml2/presentation/style.xsd +69 -0
- data/schemas/mathml2/presentation/table.xsd +216 -0
- data/schemas/mathml2/presentation/tokens.xsd +124 -0
- data/schemas/mathml3/mathml3-common.xsd +99 -0
- data/schemas/mathml3/mathml3-content.xsd +684 -0
- data/schemas/mathml3/mathml3-presentation.xsd +2151 -0
- data/schemas/mathml3/mathml3-strict-content.xsd +186 -0
- data/schemas/mathml3/mathml3.xsd +9 -0
- data/schemas/mathml4/mathml4-content.rnc +382 -0
- data/schemas/mathml4/mathml4-core.rnc +361 -0
- data/schemas/mathml4/mathml4-presentation.rnc +358 -0
- data/schemas/mathml4/mathml4-strict-content.rnc +86 -0
- data/schemas/mathml4/mathml4.rnc +21 -0
- data/schemas/mathml4/mathml4.rnc.1 +21 -0
- data/schemas/mathml4/mathml4.rng +37 -0
- metadata +249 -2
|
@@ -0,0 +1,1096 @@
|
|
|
1
|
+
<div1 id="interf" role="chapter7"><head>The MathML Interface</head>
|
|
2
|
+
<!-- $Id: interface.xml,v 1.70 2003/08/14 15:13:01 rminer Exp $ -->
|
|
3
|
+
|
|
4
|
+
<p>To be effective, MathML must work well with a wide variety of
|
|
5
|
+
renderers, processors, translators and editors. This chapter addresses
|
|
6
|
+
some of the interface issues involved in generating and rendering
|
|
7
|
+
MathML. Since MathML exists primarily to encode mathematics in Web
|
|
8
|
+
documents, perhaps the most important interface issues are related to
|
|
9
|
+
embedding MathML in <bibref ref="HTML4" /> and
|
|
10
|
+
<bibref ref="XHTML"/>.</p>
|
|
11
|
+
|
|
12
|
+
<p>There are three kinds of interface issues that arise in embedding
|
|
13
|
+
MathML in other XML documents. First, MathML must be semantically
|
|
14
|
+
integrated. MathML markup must be recognized as valid embedded XML
|
|
15
|
+
content, and not as an error. This is primarily a question of
|
|
16
|
+
managing namespaces in XML <bibref ref="Namespaces"/>.</p>
|
|
17
|
+
|
|
18
|
+
<p>Second, in the case of HTML/XHTML, MathML rendering must be
|
|
19
|
+
integrated into browser software. Some browsers already implement
|
|
20
|
+
MathML rendering natively, and one can expect more browsers will do so
|
|
21
|
+
in the future. At the same time, other browsers have developed
|
|
22
|
+
infrastructure to facilitate the rendering of MathML and other
|
|
23
|
+
embedded XML content by third-party software. Using these browser
|
|
24
|
+
specific mechanisms generally requires some additional interface
|
|
25
|
+
markup of some sort to activate them.</p>
|
|
26
|
+
|
|
27
|
+
<p>Third, other tools for generating and processing MathML must be
|
|
28
|
+
able to intercommunicate. A number of MathML tools have been or are
|
|
29
|
+
being developed, including editors, translators, computer algebra
|
|
30
|
+
systems, and other scientific software. However, since MathML
|
|
31
|
+
expressions tend to be lengthy, and prone to error when entered by
|
|
32
|
+
hand, special emphasis must be given to insuring that MathML can be
|
|
33
|
+
easily generated by user-friendly conversion and authoring tools, and
|
|
34
|
+
that these tools work together in a dependable, platform and vendor
|
|
35
|
+
independent way.</p>
|
|
36
|
+
|
|
37
|
+
<p>The W3C Math Working Group is committed to providing support to software
|
|
38
|
+
vendors developing any kind of MathML tool. The Working Group monitors
|
|
39
|
+
the public mailing list
|
|
40
|
+
<loc href="mailto:www-math@w3.org">www-math@w3.org</loc>,
|
|
41
|
+
and will attempt to answer questions about the MathML specification. The
|
|
42
|
+
Working Group works with MathML developer
|
|
43
|
+
and user groups. For current information about MathML tools, applications
|
|
44
|
+
and user support activities, consult the
|
|
45
|
+
<loc href="http://www.w3.org/Math/">home page of the W3C Math Working
|
|
46
|
+
Group</loc>.</p>
|
|
47
|
+
|
|
48
|
+
<div2 id="interf_embed"><head>Embedding MathML in other Documents</head>
|
|
49
|
+
|
|
50
|
+
<p>While MathML can be used in isolation as a language for exchanging
|
|
51
|
+
mathematical expressions between MathML-aware applications, the
|
|
52
|
+
primary anticipated use of MathML is to encode mathematical expression
|
|
53
|
+
within larger documents. MathML is ideal for embedding math
|
|
54
|
+
expressions in other applications of XML.</p>
|
|
55
|
+
|
|
56
|
+
<p>In particular, the focus here is on the mechanics of embedding
|
|
57
|
+
MathML in <bibref ref="XHTML"/>. XHTML is a W3C Recommendation
|
|
58
|
+
formulating a family of current and future XML-based document types
|
|
59
|
+
and modules that reproduce, subset, and extend HTML. While <bibref
|
|
60
|
+
ref="HTML4"/> is the dominant language of the Web at the time of
|
|
61
|
+
this writing, one may anticipate a shift from HTML to XHTML.
|
|
62
|
+
Indeed, XHTML can already be made to render properly in most HTML user
|
|
63
|
+
agents.</p>
|
|
64
|
+
|
|
65
|
+
<p>Since MathML and XHTML share a common XML framework, namespaces
|
|
66
|
+
provide a standard mechanism for embedding MathML in XHTML. While
|
|
67
|
+
some popular user agents also support inclusion of MathML directly in
|
|
68
|
+
HTML as "XML data islands," this is a transitional strategy.
|
|
69
|
+
Consult user agent documentation for specific information on
|
|
70
|
+
its support for embedding XML in HTML.</p>
|
|
71
|
+
|
|
72
|
+
<div3 id="interf_namespace"><head>MathML and Namespaces</head>
|
|
73
|
+
|
|
74
|
+
<p>Embedding MathML in XML-based documents in general, and XHTML in
|
|
75
|
+
particular, is a matter of managing namespaces. See the W3C
|
|
76
|
+
Recommendation "Namespaces in XML" <bibref
|
|
77
|
+
ref="Namespaces"/> for full details.</p>
|
|
78
|
+
|
|
79
|
+
<p>An XML namespace is a collection of names identified by a URI. The
|
|
80
|
+
URI for the MathML namespace is:</p>
|
|
81
|
+
|
|
82
|
+
<eg>
|
|
83
|
+
http://www.w3.org/1998/Math/MathML
|
|
84
|
+
</eg>
|
|
85
|
+
|
|
86
|
+
<p>Using namespaces, embedding a MathML expression in a larger XML
|
|
87
|
+
document is merely a matter of identifying the MathML markup as
|
|
88
|
+
residing in the MathML namespace. This can be accomplished by either
|
|
89
|
+
explicitly identifying each MathML element name by attaching a
|
|
90
|
+
namespace prefix, or by declaring a default namespace on an enclosing
|
|
91
|
+
element.</p>
|
|
92
|
+
|
|
93
|
+
<p>To declare a namespace, one uses an <att>xmlns</att>
|
|
94
|
+
attribute, or an attribute
|
|
95
|
+
with an <att>xmlns</att> prefix. When the <att>xmlns</att> attribute is used alone, it sets
|
|
96
|
+
the default namespace for the element on which it
|
|
97
|
+
appears, and for any children elements.</p>
|
|
98
|
+
|
|
99
|
+
<p>Example:</p>
|
|
100
|
+
|
|
101
|
+
<eg><![CDATA[
|
|
102
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
|
103
|
+
<mrow>...</mrow>
|
|
104
|
+
</math>
|
|
105
|
+
]]></eg>
|
|
106
|
+
|
|
107
|
+
<p>When the <att>xmlns</att> attribute is used as a
|
|
108
|
+
prefix, it declares a
|
|
109
|
+
prefix which can then be used to explicitly associate other elements
|
|
110
|
+
and attributes with a particular namespace.</p>
|
|
111
|
+
|
|
112
|
+
<p>Example:</p>
|
|
113
|
+
|
|
114
|
+
<eg><![CDATA[
|
|
115
|
+
<body xmlns:m="http://www.w3.org/1998/Math/MathML">
|
|
116
|
+
...
|
|
117
|
+
<m:math><m:mrow>...</m:mrow></m:math>
|
|
118
|
+
...
|
|
119
|
+
</body>
|
|
120
|
+
]]></eg>
|
|
121
|
+
|
|
122
|
+
<p>These two methods of namespace declaration can be used together.
|
|
123
|
+
For example, by using both an explicit document-wide namespace prefix,
|
|
124
|
+
and default namespace declarations on individual mathematical
|
|
125
|
+
elements, it is possible to localize namespace related markup to the
|
|
126
|
+
top-level <el>math</el> element. <phrase diff="del">This is also
|
|
127
|
+
important for implementation with some user agents, since attaching
|
|
128
|
+
rendering behaviors to an element currently requires an explicit
|
|
129
|
+
namespace prefix in these browsers. At the same time, a number of
|
|
130
|
+
MathML authoring tools are not yet namespace-aware, and thus the
|
|
131
|
+
ability to use markup without prefixes is also desirable in the short
|
|
132
|
+
term.</phrase></p>
|
|
133
|
+
|
|
134
|
+
<p>Example:</p>
|
|
135
|
+
|
|
136
|
+
<eg><![CDATA[
|
|
137
|
+
<body xmlns:m="http://www.w3.org/1998/Math/MathML">
|
|
138
|
+
...
|
|
139
|
+
<m:math xmlns="http://www.w3.org/1998/Math/MathML">
|
|
140
|
+
<mrow>...<mrow>
|
|
141
|
+
</m:math>
|
|
142
|
+
...
|
|
143
|
+
</body>
|
|
144
|
+
]]></eg>
|
|
145
|
+
|
|
146
|
+
<div4 id="interf_validation"><head>Document Validation Issues</head>
|
|
147
|
+
|
|
148
|
+
<p>The use of namespace prefixes creates an issue for DTD validation
|
|
149
|
+
of documents embedding MathML. DTD validation requires knowing the
|
|
150
|
+
literal (possibly prefixed) element names used in the document.
|
|
151
|
+
However, the Namespaces in XML Recommendation <bibref
|
|
152
|
+
ref="Namespaces"/> allows the prefix to be changed at arbitrary points
|
|
153
|
+
in the document, since namespace prefixes may be declared on any
|
|
154
|
+
element.</p>
|
|
155
|
+
|
|
156
|
+
<p>The 'historical' method of bridging this gap was to write a DTD
|
|
157
|
+
with a fixed prefix, or in the case of XHTML and MathML, with no
|
|
158
|
+
prefix, and mandate that the specified form must be used throughout
|
|
159
|
+
the document. However, this is somewhat restricting for a modular DTD
|
|
160
|
+
that is intended for use in conjunction with another DTD, which is
|
|
161
|
+
exactly the situation with MathML in XHTML. In essence, the MathML
|
|
162
|
+
DTD would have to allocate a prefix for itself and hope no
|
|
163
|
+
other module uses the same prefix to avoid name clashes, thus losing
|
|
164
|
+
one of the main benefits of XML namespaces.</p>
|
|
165
|
+
|
|
166
|
+
<p>One strategy for addressing this problem is to make every element
|
|
167
|
+
name in the DTD be accessed by an entity reference. This means that by
|
|
168
|
+
declaring a couple of entities to specify the prefix before the DTD is
|
|
169
|
+
loaded, the prefix can be chosen by a document author, and compound
|
|
170
|
+
DTDs that include several modules can, without changing the module
|
|
171
|
+
DTDs, specify unique prefixes for each module to avoid clashes. The
|
|
172
|
+
MathML DTD has been designed in this fashion. See <specref
|
|
173
|
+
ref="parsing_dtd" /> and <bibref ref="Modularization"/> for
|
|
174
|
+
details.</p>
|
|
175
|
+
|
|
176
|
+
<p>An extra issue arises in the case where explicit prefixes are used
|
|
177
|
+
on the top-level <el>math</el> element, but a default
|
|
178
|
+
namespace is used for other MathML elements. In this case, one wants
|
|
179
|
+
the MathML module to be included into XHTML with the prefix set to
|
|
180
|
+
empty. However, the 'driver' DTD file that sets up the inclusion of
|
|
181
|
+
the MathML module would then need to define a new element called
|
|
182
|
+
m:math. This would allow the top-level <el>math</el>
|
|
183
|
+
element to use an explicit prefix, for attaching rendering behaviors
|
|
184
|
+
in current browsers, while the contents would not need an explicit
|
|
185
|
+
prefix, for ease of interoperability between authoring tools, etc.</p>
|
|
186
|
+
|
|
187
|
+
</div4>
|
|
188
|
+
<div4 id="interf_compatibility"><head>Compatibility Suggestions</head>
|
|
189
|
+
|
|
190
|
+
<p>While the use of namespaces to embed MathML in other XML
|
|
191
|
+
applications is completely described by the relevant W3C
|
|
192
|
+
Recommendations, a certain degree of pragmatism is still called for at
|
|
193
|
+
present. Support for XML, namespaces and rendering behaviors in
|
|
194
|
+
popular user agents is not always fully in alignment with W3C
|
|
195
|
+
Recommendations. In some cases, the software predates the relevant
|
|
196
|
+
standards, and in other cases, the relevant standards are not yet
|
|
197
|
+
complete.</p>
|
|
198
|
+
|
|
199
|
+
<p>During the transitional period, in which some software may not be
|
|
200
|
+
fully namespace-aware, a few conventional practices will ease
|
|
201
|
+
compatibility problems:
|
|
202
|
+
|
|
203
|
+
<olist>
|
|
204
|
+
<item><p>When using namespace prefixes with MathML markup, use m: as a
|
|
205
|
+
conventional prefix for the MathML namespace. Using an explicit
|
|
206
|
+
prefix is probably safer for compatibility in current user agents.
|
|
207
|
+
</p></item>
|
|
208
|
+
|
|
209
|
+
<item><p>When using namespace prefixes, pick one and use it
|
|
210
|
+
consistently within a document.
|
|
211
|
+
</p></item>
|
|
212
|
+
|
|
213
|
+
<item><p>Explicitly declare the MathML namespace on all
|
|
214
|
+
<el>math</el> elements.
|
|
215
|
+
</p></item> </olist></p>
|
|
216
|
+
|
|
217
|
+
<p>Examples.</p>
|
|
218
|
+
|
|
219
|
+
<eg><![CDATA[
|
|
220
|
+
<body>
|
|
221
|
+
...
|
|
222
|
+
<m:math xmlns:m="http://www.w3.org/1998/Math/MathML">
|
|
223
|
+
<m:mrow>...<m:mrow>
|
|
224
|
+
</m:math>
|
|
225
|
+
...
|
|
226
|
+
</body>
|
|
227
|
+
]]></eg>
|
|
228
|
+
|
|
229
|
+
<p>Or</p>
|
|
230
|
+
<eg><![CDATA[
|
|
231
|
+
<body>
|
|
232
|
+
...
|
|
233
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
|
234
|
+
<mrow>...<mrow>
|
|
235
|
+
</math>
|
|
236
|
+
...
|
|
237
|
+
</body>
|
|
238
|
+
]]></eg>
|
|
239
|
+
|
|
240
|
+
<p>Note that these suggestions alone may not be sufficient for
|
|
241
|
+
creating functional Web pages containing MathML markup. It will
|
|
242
|
+
generally be the case that some additional document-wide markup will
|
|
243
|
+
be required. Additional work may also be required to make all MathML
|
|
244
|
+
instances in a document compatible with document-wide declarations.
|
|
245
|
+
This is particularly true when documents are created by cutting and
|
|
246
|
+
pasting MathML expressions, since current tools will probably not
|
|
247
|
+
be able to query global namespace information.</p>
|
|
248
|
+
|
|
249
|
+
<p>Consult the <loc href="http://www.w3.org/Math/">W3C Math Working
|
|
250
|
+
Group</loc> home page for compatibility and implementation suggestions
|
|
251
|
+
for current browsers and other MathML-aware tools.</p>
|
|
252
|
+
|
|
253
|
+
</div4>
|
|
254
|
+
</div3>
|
|
255
|
+
<div3 id="interf_toplevel"><head>The Top-Level
|
|
256
|
+
<el>math</el> Element</head>
|
|
257
|
+
|
|
258
|
+
<p>MathML specifies a single top-level or root <el>math</el> element, which encapsulates each instance of
|
|
259
|
+
MathML markup within a document. All other MathML content must be
|
|
260
|
+
contained in a <el>math</el> element; equivalently,
|
|
261
|
+
every valid, complete MathML expression must be contained in <el role="starttag">math</el> tags. The <el>math</el>
|
|
262
|
+
element must always be the outermost element in a MathML expression;
|
|
263
|
+
it is an error for one <el>math</el> element to contain
|
|
264
|
+
another.</p>
|
|
265
|
+
|
|
266
|
+
<p>Applications that return sub-expressions of other MathML
|
|
267
|
+
expressions, for example, as the result of a cut-and-paste operation,
|
|
268
|
+
should always wrap them in <el role="starttag">math</el>
|
|
269
|
+
tags. Ideally, the presence of enclosing <el role="starttag">math</el>
|
|
270
|
+
tags should be a very good heuristic test for MathML
|
|
271
|
+
material. Similarly, applications which insert MathML expressions in
|
|
272
|
+
other MathML expressions must take care to remove the <el role="starttag">math</el> tags from the inner expressions.</p>
|
|
273
|
+
|
|
274
|
+
<p>The <el>math</el> element can contain an arbitrary number
|
|
275
|
+
of children schemata. The children schemata render by default as if they
|
|
276
|
+
were contained in an <el>mrow</el> element.</p>
|
|
277
|
+
|
|
278
|
+
<p>The attributes of the <el>math</el> element are:
|
|
279
|
+
<glist>
|
|
280
|
+
<gitem><label>class, id, style</label>
|
|
281
|
+
<def><p>Provided for use with stylesheets.</p></def>
|
|
282
|
+
</gitem>
|
|
283
|
+
|
|
284
|
+
<gitem><label>xref</label>
|
|
285
|
+
<def><p>Provided along with <att>id</att> for use
|
|
286
|
+
with XSL processing (See <specref ref="mixing_tools" />)</p></def>
|
|
287
|
+
</gitem>
|
|
288
|
+
|
|
289
|
+
<gitem><label>macros</label>
|
|
290
|
+
<def><p>This attribute provides a way of pointing to
|
|
291
|
+
external macro definition files. Macros are not part of the MathML
|
|
292
|
+
specification, and much of the functionality provided by macros in MathML can be
|
|
293
|
+
accommodated by XSL transformations <bibref ref="XSLT"/>. However, the <att>macros</att> attribute is provided to make possible future
|
|
294
|
+
development of more streamlined, MathML-specific macro mechanisms. The
|
|
295
|
+
value of this attribute is a sequence of URLs or URIs, separated by
|
|
296
|
+
whitespace</p></def>
|
|
297
|
+
</gitem>
|
|
298
|
+
|
|
299
|
+
<gitem>
|
|
300
|
+
<label>mode</label>
|
|
301
|
+
<def><p>The <att>mode</att> attribute specifies whether
|
|
302
|
+
the enclosed MathML expression should be rendered in a display style
|
|
303
|
+
or an in-line style. Allowed values are
|
|
304
|
+
<attval>display</attval> and
|
|
305
|
+
<attval>inline</attval> (default).
|
|
306
|
+
This attribute is <intref ref="interf_deprec">deprecated</intref> in
|
|
307
|
+
favor of the new <att>display</att> attribute, or the
|
|
308
|
+
<loc href="http://www.w3.org/TR/CSS2/visuren.html#propdef-display">CSS2
|
|
309
|
+
'display' property</loc> with the analogous <kw>block</kw> and
|
|
310
|
+
<kw>inline</kw> values.</p></def>
|
|
311
|
+
</gitem>
|
|
312
|
+
|
|
313
|
+
<gitem>
|
|
314
|
+
<label>display</label>
|
|
315
|
+
<def><p>The <att>display</att> attribute replaces the
|
|
316
|
+
deprecated <att>mode</att> <phrase diff="chg">attribute</phrase>.
|
|
317
|
+
It specifies whether
|
|
318
|
+
the enclosed MathML expression should be rendered in a display style
|
|
319
|
+
or an in-line style. Allowed values are
|
|
320
|
+
<attval>block</attval> and
|
|
321
|
+
<attval>inline</attval> (default).
|
|
322
|
+
</p></def>
|
|
323
|
+
</gitem>
|
|
324
|
+
|
|
325
|
+
</glist>
|
|
326
|
+
</p>
|
|
327
|
+
|
|
328
|
+
<p>The attributes of the <el>math</el> element affect
|
|
329
|
+
the entire enclosed expression. They are, in a sense, <quote>inward
|
|
330
|
+
looking</quote>. However, to render MathML properly in a browser, and
|
|
331
|
+
to integrate it properly into an XHTML document, a second collection
|
|
332
|
+
of <quote>outward looking</quote> attributes are also useful.</p>
|
|
333
|
+
|
|
334
|
+
<p>While general mechanisms for attaching rendering behaviors to
|
|
335
|
+
elements in XML documents are under development, wide variations in
|
|
336
|
+
strategy and level of implementation remain between various existing
|
|
337
|
+
user agents. Consequently, the remainder of this section describes
|
|
338
|
+
attributes and functionality that are desirable for integrating
|
|
339
|
+
third-party rendering modules with user agents:
|
|
340
|
+
|
|
341
|
+
<glist>
|
|
342
|
+
<gitem><label>overflow</label> <def><p>In cases where size negotiation
|
|
343
|
+
is not possible or fails (for example in the case of an extremely long
|
|
344
|
+
equation), this attribute is provided to suggest an alternative
|
|
345
|
+
processing method to the renderer. Allowed values are <glist>
|
|
346
|
+
<gitem><label>scroll</label> <def><p>The window provides a viewport
|
|
347
|
+
into the larger complete display of the mathematical
|
|
348
|
+
expression. Horizontal or vertical scrollbars are added to the window
|
|
349
|
+
as necessary to allow the viewport to be moved to a different
|
|
350
|
+
position.</p></def> </gitem>
|
|
351
|
+
|
|
352
|
+
<gitem><label>elide</label>
|
|
353
|
+
<def><p>The display is abbreviated by removing enough of it so that
|
|
354
|
+
the remainder fits into the window. For example, a large polynomial
|
|
355
|
+
might have the first and last terms displayed with <quote>+ ... +</quote> between
|
|
356
|
+
them. Advanced renderers may provide a facility to zoom in on elided
|
|
357
|
+
areas.</p></def>
|
|
358
|
+
</gitem>
|
|
359
|
+
|
|
360
|
+
<gitem><label>truncate</label>
|
|
361
|
+
<def><p>The display is abbreviated by simply truncating it at the right and
|
|
362
|
+
bottom borders. It is recommended that some indication of truncation is
|
|
363
|
+
made to the viewer.</p></def>
|
|
364
|
+
</gitem>
|
|
365
|
+
|
|
366
|
+
<gitem><label>scale</label>
|
|
367
|
+
<def><p>The fonts used to display the mathematical expression are
|
|
368
|
+
chosen so that the full expression fits in the window. Note that this
|
|
369
|
+
only happens if the expression is too large. In the case of a window
|
|
370
|
+
larger than necessary, the expression is shown at its normal size
|
|
371
|
+
within the larger window.</p></def>
|
|
372
|
+
</gitem>
|
|
373
|
+
</glist>
|
|
374
|
+
</p>
|
|
375
|
+
</def>
|
|
376
|
+
</gitem>
|
|
377
|
+
|
|
378
|
+
<gitem><label>altimg</label>
|
|
379
|
+
<def><p>This attribute provides a graceful fall-back for browsers that do
|
|
380
|
+
not support embedded elements. The value of the
|
|
381
|
+
attribute is an URL.</p></def>
|
|
382
|
+
</gitem>
|
|
383
|
+
|
|
384
|
+
<gitem><label>alttext</label>
|
|
385
|
+
<def><p>This attribute provides a graceful fall-back for browsers that do
|
|
386
|
+
not support embedded elements or images.
|
|
387
|
+
The value of the attribute is a text string.</p></def>
|
|
388
|
+
</gitem>
|
|
389
|
+
|
|
390
|
+
</glist>
|
|
391
|
+
</p>
|
|
392
|
+
</div3>
|
|
393
|
+
|
|
394
|
+
<div3><head>Invoking MathML Processors</head>
|
|
395
|
+
|
|
396
|
+
<p>In browsers where MathML is not natively supported, it is anticipated
|
|
397
|
+
that MathML rendering will be carried out via embedded objects such as
|
|
398
|
+
plug-ins, applets, or helper applications. The direction which has
|
|
399
|
+
begun emerging for invoking third-party rendering and processing
|
|
400
|
+
software is elucidated in the W3C Working Draft "Behavioral
|
|
401
|
+
Extensions to CSS" <bibref ref="Behaviors" />.</p>
|
|
402
|
+
|
|
403
|
+
<p>Behavioral extensions use the linking mechanism of CSS to attach
|
|
404
|
+
executable components to elements. Typically, the executable
|
|
405
|
+
components involve script code which manipulate the DOM to instantiate
|
|
406
|
+
other MathML processing components. Using experimental
|
|
407
|
+
implementations of behavior extensions in current user agents, it is
|
|
408
|
+
possible to attach processing components to <el>math</el> elements which then carry out the rendering
|
|
409
|
+
of MathML markup in an XHTML page.</p>
|
|
410
|
+
|
|
411
|
+
<p>Work on on Behavior Extensions to CSS is ongoing at W3C, and
|
|
412
|
+
existing implementations must be regarded as non-standard at this time.
|
|
413
|
+
However, it offers a very promising direction for powerful and
|
|
414
|
+
flexible invocation of third-party MathML processors.</p>
|
|
415
|
+
|
|
416
|
+
<p>MIME types <bibref ref="RFC2045" />, <bibref ref="RFC2046" /> offer
|
|
417
|
+
an alternative strategy that can also be used in current user agents
|
|
418
|
+
to invoke a MathML renderer. This is primarily useful when
|
|
419
|
+
referencing separate files containing MathML markup from an <el
|
|
420
|
+
namespace="xhtml">embed</el> or <el namespace="xhtml">object</el> element.
|
|
421
|
+
<bibref ref="RFC3023" /> assigns MathML the MIME type
|
|
422
|
+
<code>application/mathml+xml</code>. The W3C Math Working Group
|
|
423
|
+
recommends the standard file extension <code>.mml</code> used for
|
|
424
|
+
browser registry.</p>
|
|
425
|
+
|
|
426
|
+
<p>In MathML 1.0, <code>text/mathml</code> was given as the suggested
|
|
427
|
+
MIME type. This has been superceded by RFC3023.</p>
|
|
428
|
+
|
|
429
|
+
<p>Although rendering MathML expressions typically occurs in place in
|
|
430
|
+
a Web browser, other MathML processing functions take place more
|
|
431
|
+
naturally in other applications. Particularly common tasks include
|
|
432
|
+
opening a MathML expression in an equation editor or computer algebra
|
|
433
|
+
system.</p>
|
|
434
|
+
|
|
435
|
+
<p>At present, there is no standard way of selecting between various
|
|
436
|
+
applications which might be used to render or process embedded MathML.
|
|
437
|
+
As work progresses on coordination between browsers and embedded
|
|
438
|
+
elements and the Document Object Model <bibref ref="DOM" />, providing
|
|
439
|
+
this kind of functionality should be a priority. Both authors and
|
|
440
|
+
readers should be able to indicate a preference about what MathML
|
|
441
|
+
application to use in a given context. For example, one might imagine
|
|
442
|
+
that some mouse gesture over a MathML expression causes a browser to
|
|
443
|
+
present the reader with a pop-up menu, showing the various kinds of
|
|
444
|
+
MathML processing available on the system, and the MathML processors
|
|
445
|
+
recommended by the author.</p>
|
|
446
|
+
|
|
447
|
+
<p>Since MathML is most often generated by authoring tools, it is
|
|
448
|
+
particularly important that opening a MathML expression in an editor should
|
|
449
|
+
be easy to do and to implement. In many cases, it will be desirable for an
|
|
450
|
+
authoring tool to record some information about its internal state along
|
|
451
|
+
with a MathML expression, so that an author can pick up editing where he or
|
|
452
|
+
she left off. The MathML specification does not explicitly contain
|
|
453
|
+
provisions for recording information about the authoring tool. In some
|
|
454
|
+
circumstances, it may be possible to include authoring tool information
|
|
455
|
+
that applies to an entire document in the form of meta-data; interested
|
|
456
|
+
readers are encouraged to consult the <loc
|
|
457
|
+
href="http://www.w3.org/Metadata/">W3C Metadata Activity</loc> for current
|
|
458
|
+
information about metadata and resource definition. For encoding authoring
|
|
459
|
+
tool state information that applies to a particular MathML instance,
|
|
460
|
+
readers are referred to the possible use of the <el>semantics</el> element for this purpose <specref
|
|
461
|
+
ref="contm_semantics"/>.</p>
|
|
462
|
+
|
|
463
|
+
<p>In the short term, regardless of the methodology, implementors of
|
|
464
|
+
embedded MathML processing applications are encouraged to try to allow for
|
|
465
|
+
the following kinds of functionality:
|
|
466
|
+
|
|
467
|
+
<ulist>
|
|
468
|
+
<item><p>An author wishing to reach an audience as wide as possible
|
|
469
|
+
might want MathML to be rendered by any available processor.</p>
|
|
470
|
+
</item>
|
|
471
|
+
|
|
472
|
+
<item><p>An author targeting a specific audience might want to indicate that
|
|
473
|
+
a particular MathML processor be used.</p>
|
|
474
|
+
</item>
|
|
475
|
+
|
|
476
|
+
<item><p>A reader might wish to specify which of several available
|
|
477
|
+
processors installed locally should be used.</p>
|
|
478
|
+
</item>
|
|
479
|
+
</ulist>
|
|
480
|
+
</p>
|
|
481
|
+
|
|
482
|
+
</div3>
|
|
483
|
+
|
|
484
|
+
<div3 id="interf_link"><head>Mixing and Linking MathML and HTML</head>
|
|
485
|
+
|
|
486
|
+
<p>In order to fully integrate MathML into XHTML, it should be possible
|
|
487
|
+
not only to embed MathML in XHTML, but also to embed XHTML in MathML.
|
|
488
|
+
However, the problem of supporting XHTML in MathML presents many
|
|
489
|
+
difficulties. Therefore, at present, the MathML specification does not
|
|
490
|
+
permit any XHTML elements within a MathML expression, although this
|
|
491
|
+
may be subject to change in a future revision of MathML.</p>
|
|
492
|
+
|
|
493
|
+
<p>In most cases, XHTML elements (headings, paragraphs, lists, etc.)
|
|
494
|
+
either do not apply in mathematical contexts, or MathML already
|
|
495
|
+
provides equivalent or better functionality specifically tailored to
|
|
496
|
+
mathematical content (tables, mathematics style changes,
|
|
497
|
+
etc.). However, there are two notable exceptions, the XHTML anchor and
|
|
498
|
+
image elements. For this functionality, MathML relies on the general
|
|
499
|
+
XML linking and graphics mechanisms being developed by other W3C
|
|
500
|
+
Activities. </p>
|
|
501
|
+
|
|
502
|
+
<div4><head>Linking</head>
|
|
503
|
+
|
|
504
|
+
<p>MathML has no element that corresponds to the XHTML anchor element
|
|
505
|
+
<var>a</var>. In XHTML, anchors are used both to make links, and to
|
|
506
|
+
provide locations to which a link can be made. MathML, as an XML
|
|
507
|
+
application, defines links by the use of the mechanism described in
|
|
508
|
+
the W3C <phrase diff="del">Candidate</phrase> Recommendation "XML
|
|
509
|
+
Linking Language" <bibref ref="XLink"/>.<phrase diff="del">The reader
|
|
510
|
+
is cautioned that at the time of this writing, XLink is not yet a
|
|
511
|
+
Recommendation, and is therefore subject to future revision. Since the
|
|
512
|
+
MathML linking mechanism is defined in terms of the XML linking
|
|
513
|
+
specification, the same proviso holds for it as well.</phrase></p>
|
|
514
|
+
|
|
515
|
+
<p>A MathML element is designated as a link by the presence of the
|
|
516
|
+
attribute <att>xlink:href</att>. To use the attribute <att>xlink:href</att>, it is also necessary to declare the
|
|
517
|
+
appropriate namespace. Thus, a typical MathML link might look like:
|
|
518
|
+
<eg><![CDATA[
|
|
519
|
+
<mrow xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
520
|
+
xlink:href="sample.xml">
|
|
521
|
+
...
|
|
522
|
+
</mrow>
|
|
523
|
+
]]></eg>
|
|
524
|
+
</p>
|
|
525
|
+
<p>MathML designates that almost all elements can be used as XML linking
|
|
526
|
+
elements. The only elements that cannot serve as linking elements are those
|
|
527
|
+
such as the <el>sep</el> element, which exist primarily to
|
|
528
|
+
disambiguate other MathML constructs and in general do not correspond to
|
|
529
|
+
any part of a typical visual rendering. The full list of exceptional
|
|
530
|
+
elements that cannot be used as linking elements is given in the table
|
|
531
|
+
below.
|
|
532
|
+
<table width="75%">
|
|
533
|
+
<thead>
|
|
534
|
+
<tr><td colspan="3">MathML elements that cannot be linking elements.</td></tr>
|
|
535
|
+
</thead>
|
|
536
|
+
<tbody>
|
|
537
|
+
<tr>
|
|
538
|
+
<td><el>mprescripts</el></td>
|
|
539
|
+
<td><el>none</el></td>
|
|
540
|
+
<td><el>sep</el></td>
|
|
541
|
+
</tr>
|
|
542
|
+
<tr>
|
|
543
|
+
<td><el>malignmark</el></td>
|
|
544
|
+
<td><el>maligngroup</el></td>
|
|
545
|
+
<td></td>
|
|
546
|
+
</tr>
|
|
547
|
+
</tbody>
|
|
548
|
+
</table>
|
|
549
|
+
</p>
|
|
550
|
+
|
|
551
|
+
<p>Note that the XML Linking <bibref
|
|
552
|
+
ref="XLink"/> and XML Pointer Language <bibref
|
|
553
|
+
ref="XPointer"/> specifications also define how to link
|
|
554
|
+
<emph>into</emph> a MathML expressions. Be aware, however, that such
|
|
555
|
+
links may or may not be properly interpreted in current software.</p>
|
|
556
|
+
</div4>
|
|
557
|
+
|
|
558
|
+
<div4><head>Images</head>
|
|
559
|
+
|
|
560
|
+
<p>The <el namespace="xhtml">img</el> element has no MathML
|
|
561
|
+
equivalent. The decision to omit a general mechanism for image
|
|
562
|
+
inclusion from MathML was based on several factors. However, the main
|
|
563
|
+
reason for not providing an image facility is that MathML takes great
|
|
564
|
+
pains to make the notational structure and mathematical content it
|
|
565
|
+
encodes easily available to processors, whereas information contained
|
|
566
|
+
in images is only available to a human reader looking at a visual
|
|
567
|
+
representation. Thus, for example, in the MathML paradigm, it would be
|
|
568
|
+
preferable to introduce new glyphs via the <el>mglyph</el> element which at a minimum identifies them
|
|
569
|
+
as glyphs, rather than simply including them as images.</p>
|
|
570
|
+
</div4>
|
|
571
|
+
</div3>
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
<div3 id="interf_graphics" diff="add"><head>MathML and Graphical Markup</head>
|
|
575
|
+
|
|
576
|
+
<p>Apart from the introduction of new glyphs, many of the situations
|
|
577
|
+
where one might be inclined to use an image amount to displaying
|
|
578
|
+
labeled diagrams. For example, knot diagrams, Venn diagrams, Dynkin
|
|
579
|
+
diagrams, Feynman diagrams and commutative diagrams all fall into this
|
|
580
|
+
category. As such, their content would be better encoded via some
|
|
581
|
+
combination of structured graphics and MathML markup. However, at the
|
|
582
|
+
time of this writing, it is beyond the scope of the W3C Math Activity
|
|
583
|
+
to define a markup language to encode such a general concept as
|
|
584
|
+
<quote>labeled diagrams.</quote> (See <loc
|
|
585
|
+
href="http://www.w3.org/Math/">http://www.w3.org/Math</loc> for
|
|
586
|
+
current W3C activity in mathematics and <loc
|
|
587
|
+
href="http://www.w3.org/Graphics/">http://www.w3.org/Graphics</loc>
|
|
588
|
+
for the W3C graphics activity.)</p>
|
|
589
|
+
|
|
590
|
+
<p>One mechanism for embedding additional graphical content is via the
|
|
591
|
+
<el>semantics</el> element, as in the following example:
|
|
592
|
+
<eg><![CDATA[<semantics>
|
|
593
|
+
<apply>
|
|
594
|
+
<intersect/>
|
|
595
|
+
<ci>A</ci>
|
|
596
|
+
<ci>B</ci>
|
|
597
|
+
</apply>
|
|
598
|
+
<annotation-xml encoding="SVG1.1">
|
|
599
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 290 180">
|
|
600
|
+
<clipPath id="a">
|
|
601
|
+
<circle cy="90" cx="100" r="60"/>
|
|
602
|
+
</clipPath>
|
|
603
|
+
<circle fill="#AAAAAA" cy="90" cx="190"
|
|
604
|
+
r="60" style="clip-path:url(#a)"/>
|
|
605
|
+
<circle stroke="black" fill="none" cy="90" cx="100" r="60"/>
|
|
606
|
+
<circle stroke="black" fill="none" cy="90" cx="190" r="60"/>
|
|
607
|
+
</svg>
|
|
608
|
+
</annotation-xml>
|
|
609
|
+
<annotation-xml encoding="application/xhtml+xml">
|
|
610
|
+
<img xmlns="http://www.w3.org/1999/xhtml" src="intersect.gif" alt="A intersect B"/>
|
|
611
|
+
</annotation-xml>
|
|
612
|
+
</semantics>]]></eg>
|
|
613
|
+
Here, the <el>annotation-xml</el> elements are used to indicate alternative
|
|
614
|
+
representations of the Content MathML depiction of the
|
|
615
|
+
intersection of two sets.
|
|
616
|
+
The first one is in the <quote>Scalable Vector
|
|
617
|
+
Graphics</quote> format <bibref ref="SVG1.1"/>
|
|
618
|
+
(see <bibref ref="XHTML-MathML-SVG"/> for the definition of an XHTML profile integrating MathML and SVG), the second one uses the
|
|
619
|
+
XHTML <el namespace="xhtml">img</el> element embedded as an XHTML fragment.
|
|
620
|
+
In this situation, a MathML processor can use any of these
|
|
621
|
+
representations for display, perhaps producing a graphical format
|
|
622
|
+
such as the image below.</p>
|
|
623
|
+
|
|
624
|
+
<graphic role="display" source="image/intersect.gif" alt="\includegraphics{intersect}"/>
|
|
625
|
+
|
|
626
|
+
<p>Note that the semantics representation of this example is given
|
|
627
|
+
in the Content MathML markup, as the first child of the
|
|
628
|
+
<el>semantics</el> element. In this regard, it is the
|
|
629
|
+
representation most analogous to the <att>alt</att> attribute of the
|
|
630
|
+
<el namespace="xhtml">img</el> element in XHTML, and would likely be
|
|
631
|
+
the best choice for non-visual rendering.</p>
|
|
632
|
+
|
|
633
|
+
</div3>
|
|
634
|
+
|
|
635
|
+
<div3 id="interf_style"><head>Using CSS with MathML</head>
|
|
636
|
+
|
|
637
|
+
<p>When MathML is rendered in an environment
|
|
638
|
+
that supports CSS, controlling mathematics style properties with a CSS
|
|
639
|
+
stylesheet is obviously desirable.
|
|
640
|
+
MathML 2.0 has significantly redesigned the way presentation element
|
|
641
|
+
style properties are organized to facilitate better interaction
|
|
642
|
+
between MathML renderers and CSS style mechanisms. It introduces four
|
|
643
|
+
new <emph>mathematics style</emph> attributes with logical values. Roughly
|
|
644
|
+
speaking, these attributes can be viewed as the proper selectors for
|
|
645
|
+
CSS rules that affect MathML.</p>
|
|
646
|
+
|
|
647
|
+
<p>Controlling mathematics styling is not as simple as it might first appear
|
|
648
|
+
because mathematics styling and text styling are quite different in
|
|
649
|
+
character. In text, meaning is primarily carried by the relative
|
|
650
|
+
positioning of characters next to one another to form words. Thus,
|
|
651
|
+
although the font used to render text may impart nuances to the
|
|
652
|
+
meaning, transforming the typographic properties of the individual
|
|
653
|
+
characters leaves the meaning of text basically intact. By contrast,
|
|
654
|
+
in mathematical expressions, individual characters in specific
|
|
655
|
+
typefaces tend to function as atomic symbols. Thus, in the same
|
|
656
|
+
equation, a bold italic 'x' and a normal italic 'x' are almost always
|
|
657
|
+
intended to be two distinct symbols that mean different things. In
|
|
658
|
+
traditional usage, there are eight basic typographical categories
|
|
659
|
+
of symbols. These categories are described by mathematics style
|
|
660
|
+
attributes, primarily the <att>mathvariant</att>
|
|
661
|
+
attribute.</p>
|
|
662
|
+
|
|
663
|
+
<p>Text and mathematics layout also obviously differ in that
|
|
664
|
+
mathematics uses 2-dimensional layout. As a result, many of the style
|
|
665
|
+
parameters that affect mathematics layout have no textual analogs.
|
|
666
|
+
Even in cases where there are analogous properties, the sensible
|
|
667
|
+
values for these properties may not correspond. For example,
|
|
668
|
+
traditional mathematical typography usually uses italic fonts for
|
|
669
|
+
single character identifiers, and upright fonts for multicharacter
|
|
670
|
+
identifier. In text, italicization does not usually depend on the
|
|
671
|
+
number of letters in a word. Thus although a font-slant property
|
|
672
|
+
makes sense for both mathematics and text, the natural default values
|
|
673
|
+
are quite different.</p>
|
|
674
|
+
|
|
675
|
+
<p>Because of the difference between text and mathematics styling, only some
|
|
676
|
+
aspects of MathML layout are good candidates for CSS control. MathML
|
|
677
|
+
2.0 captures the most important properties with the new mathematics style
|
|
678
|
+
attributes, and users should try to use them whenever possible over
|
|
679
|
+
more direct, but less robust, approaches. A sample CSS stylesheet
|
|
680
|
+
illustrating the use of the mathematical
|
|
681
|
+
style attributes is available in <specref ref="stylesheet"/></p>
|
|
682
|
+
|
|
683
|
+
<p>Generally speaking, the model for CSS interaction with the math
|
|
684
|
+
style attributes runs as follows. A CSS style sheet might provide a style
|
|
685
|
+
rule such as:</p>
|
|
686
|
+
|
|
687
|
+
<eg><![CDATA[
|
|
688
|
+
math *.[mathsize="small"] {
|
|
689
|
+
font-size: 80%
|
|
690
|
+
}
|
|
691
|
+
]]></eg>
|
|
692
|
+
|
|
693
|
+
<p>This rule sets the CSS font-size properties for all children of the
|
|
694
|
+
<el>math</el> element that have the <att>mathsize</att> attribute set to small. A MathML renderer
|
|
695
|
+
would then query the style engine for the CSS environment, and use the
|
|
696
|
+
values returned as input to its own layout algorithms. MathML does
|
|
697
|
+
not specify the mechanism by which style information is inherited from
|
|
698
|
+
the environment. However, some suggested rendering rules for the
|
|
699
|
+
interaction between properties of the ambient style environment and
|
|
700
|
+
MathML-specific rendering rules are discussed in <specref
|
|
701
|
+
ref="presm_commatt"/>, and more generally throughout <specref
|
|
702
|
+
ref="presm"/>.</p>
|
|
703
|
+
|
|
704
|
+
<p>It should be stressed, however, that some caution is required in
|
|
705
|
+
writing CSS stylesheets for MathML. Because changing typographic
|
|
706
|
+
properties of mathematics symbols can change the meaning of an equation,
|
|
707
|
+
stylesheet should be written in a way such that changes to document-wide
|
|
708
|
+
typographic styles do not affect embedded MathML expressions. By
|
|
709
|
+
using the MathML 2.0 mathematics style attributes as selectors for CSS rules,
|
|
710
|
+
this danger is minimized.</p>
|
|
711
|
+
|
|
712
|
+
<p>Another pitfall to be avoided is using CSS to provide
|
|
713
|
+
typographic style information necessary to the proper understanding of
|
|
714
|
+
an expression. Expressions dependent on CSS for meaning will not be
|
|
715
|
+
portable to non-CSS environments such as computer algebra systems. By
|
|
716
|
+
using the logical values of the new MathML 2.0 mathematics style attributes
|
|
717
|
+
as selectors for CSS rules, it can be assured that style information
|
|
718
|
+
necessary to the sense of an expression is encoded directly in the
|
|
719
|
+
MathML.</p>
|
|
720
|
+
|
|
721
|
+
<p>MathML 2.0 does not specify how a user agent should process style
|
|
722
|
+
information, because there are many non-CSS MathML environments, and
|
|
723
|
+
because different users agents and renderers have widely varying
|
|
724
|
+
degrees of access to CSS information. In general, however, developers
|
|
725
|
+
are urged to provide as much CSS support for MathML as possible.</p>
|
|
726
|
+
</div3>
|
|
727
|
+
</div2>
|
|
728
|
+
|
|
729
|
+
<div2 id="interf_genproc"><head>Conformance</head>
|
|
730
|
+
|
|
731
|
+
<p>Information is increasingly generated, processed and rendered by
|
|
732
|
+
software tools. The exponential growth of the Web is fueling the
|
|
733
|
+
development of advanced systems for automatically searching,
|
|
734
|
+
categorizing, and interconnecting information. Thus, although MathML
|
|
735
|
+
can be written by hand and read by humans, the future of MathML is
|
|
736
|
+
largely tied to the ability to process it with software tools.</p>
|
|
737
|
+
|
|
738
|
+
<p>There are many different kinds of MathML <phrase diff="chg">
|
|
739
|
+
processors: editors for authoring MathML expressions, translators for
|
|
740
|
+
converting to and from other encodings, validators for checking MathML
|
|
741
|
+
expressions, computation engines that evaluate, manipulate or compare
|
|
742
|
+
MathML expressions, and rendering engines that produce visual, aural
|
|
743
|
+
or tactile representations of mathematical notation.</phrase> What it
|
|
744
|
+
means to support MathML varies widely between applications. For
|
|
745
|
+
example, the issues that arise with a <phrase diff="del">MathML-compliant</phrase> validating
|
|
746
|
+
parser are very different from those for a <phrase diff="del">MathML-compliant</phrase> equation
|
|
747
|
+
editor.</p>
|
|
748
|
+
|
|
749
|
+
<p>In this section, guidelines are given for describing different types
|
|
750
|
+
of MathML support, and for quantifying the extent of MathML support in
|
|
751
|
+
a given application. Developers, users and reviewers are encouraged
|
|
752
|
+
to use these guidelines in characterizing products. The intention
|
|
753
|
+
behind these guidelines is to facilitate reuse and interoperability
|
|
754
|
+
between MathML applications by accurately characterizing their
|
|
755
|
+
capabilities in quantifiable terms.</p>
|
|
756
|
+
|
|
757
|
+
<p>The W3C Math Working Group maintains <loc
|
|
758
|
+
href="http://www.w3.org/Math/iandi/compliance" diff="chg">MathML 2.0 Conformance
|
|
759
|
+
Guidelines</loc>. Consult this document for future updates on
|
|
760
|
+
conformance activities and resources.
|
|
761
|
+
</p>
|
|
762
|
+
|
|
763
|
+
<div3><head diff="chg">MathML Conformance</head>
|
|
764
|
+
|
|
765
|
+
<p>A valid MathML expression is an XML construct determined by the MathML
|
|
766
|
+
DTD together with the additional requirements given in this specification.</p>
|
|
767
|
+
|
|
768
|
+
<p>Define a <quote>MathML processor</quote> to mean any application that
|
|
769
|
+
can accept, produce, or <quote>roundtrip</quote> a valid MathML
|
|
770
|
+
expression. An example of an application that might round-trip a MathML
|
|
771
|
+
expression might be an editor that writes a new file even though no
|
|
772
|
+
modifications are made.</p>
|
|
773
|
+
|
|
774
|
+
<p>Three forms of MathML <phrase diff="chg">conformance</phrase> are specified:
|
|
775
|
+
<olist>
|
|
776
|
+
<item><p>A MathML-input-<phrase diff="chg">conformant</phrase> processor must accept all valid MathML
|
|
777
|
+
expressions, and faithfully translate all MathML expressions into
|
|
778
|
+
application-specific form allowing native application operations to be
|
|
779
|
+
performed.</p>
|
|
780
|
+
</item>
|
|
781
|
+
|
|
782
|
+
<item><p>A MathML-output-<phrase diff="chg">conformant</phrase> processor must generate valid MathML,
|
|
783
|
+
faithfully representing all <phrase>application-specific</phrase> data.</p>
|
|
784
|
+
</item>
|
|
785
|
+
|
|
786
|
+
<item><p>A MathML-roundtrip-<phrase diff="chg">conformant</phrase> processor must preserve MathML
|
|
787
|
+
equivalence. Two MathML expressions are <quote>equivalent</quote> if and
|
|
788
|
+
only if both expressions have the same interpretation (as stated by the
|
|
789
|
+
MathML DTD and specification) under any circumstances, by any MathML
|
|
790
|
+
processor. Equivalence on an element-by-element basis is discussed
|
|
791
|
+
elsewhere in this document.</p>
|
|
792
|
+
</item>
|
|
793
|
+
</olist>
|
|
794
|
+
</p>
|
|
795
|
+
|
|
796
|
+
<p>Beyond the above definitions, the MathML specification makes no demands
|
|
797
|
+
of individual processors. In order to guide developers, the MathML
|
|
798
|
+
specification includes advisory material; for example, there are many suggested
|
|
799
|
+
rendering rules throughout <specref ref="presm"/>. However, in general,
|
|
800
|
+
developers are given wide latitude in interpreting what kind of MathML
|
|
801
|
+
implementation is meaningful for their own particular application.</p>
|
|
802
|
+
|
|
803
|
+
<p>To clarify the difference between <phrase diff="chg">conformance</phrase> and interpretation of
|
|
804
|
+
what is meaningful, consider some examples:
|
|
805
|
+
<olist>
|
|
806
|
+
<item><p>In order to be MathML-input-<phrase diff="chg">conformant</phrase>, a validating parser needs
|
|
807
|
+
only to accept expressions, and return <quote>true</quote> for
|
|
808
|
+
expressions that are valid MathML. In particular, it need not render or
|
|
809
|
+
interpret the MathML expressions at all.</p>
|
|
810
|
+
</item>
|
|
811
|
+
|
|
812
|
+
<item><p>A MathML computer-algebra interface based on content markup might
|
|
813
|
+
choose to ignore all presentation markup. Provided the interface accepts
|
|
814
|
+
all valid MathML expressions including those containing presentation markup,
|
|
815
|
+
it would be technically correct to characterize the application as
|
|
816
|
+
MathML-input-<phrase diff="chg">conformant</phrase>.</p>
|
|
817
|
+
</item>
|
|
818
|
+
|
|
819
|
+
<item><p>An equation editor might have an internal data representation
|
|
820
|
+
that makes it easy to export some equations as MathML but not
|
|
821
|
+
others. If the editor exports the simple equations as valid MathML,
|
|
822
|
+
and merely displays an error message to the effect that conversion
|
|
823
|
+
failed for the others, it is still technically
|
|
824
|
+
MathML-output-<phrase diff="chg">conformant</phrase>.</p> </item> </olist> </p>
|
|
825
|
+
|
|
826
|
+
<div4 id="interf_testsuite"><head>MathML Test Suite and Validator</head>
|
|
827
|
+
|
|
828
|
+
<p>As the previous examples show, to be useful, the concept of MathML
|
|
829
|
+
<phrase diff="chg">conformance</phrase> frequently involves a judgment about what parts of the
|
|
830
|
+
language are meaningfully implemented, as opposed to parts that are
|
|
831
|
+
merely processed in a technically correct way with respect to the
|
|
832
|
+
definitions of <phrase diff="chg">conformance</phrase>. This requires some mechanism for giving a
|
|
833
|
+
quantitative statement about which parts of MathML are meaningfully
|
|
834
|
+
implemented by a given application. To this end, the W3C Math Working
|
|
835
|
+
Group has provided a <loc href="http://www.w3.org/Math/testsuite/">test
|
|
836
|
+
suite</loc>.</p>
|
|
837
|
+
|
|
838
|
+
<p>The test suite consists of a large number of MathML expressions
|
|
839
|
+
categorized by markup category and dominant MathML element being
|
|
840
|
+
tested. The existence of this test suite makes it possible, for example,
|
|
841
|
+
to characterize quantitatively the hypothetical computer algebra interface
|
|
842
|
+
mentioned above by saying that it is a MathML-input<phrase diff="chg">-conformant</phrase> processor
|
|
843
|
+
which meaningfully implements MathML content markup, including all of
|
|
844
|
+
the expressions in the content markup section of the test suite.</p>
|
|
845
|
+
|
|
846
|
+
<p>Developers who choose not to implement parts of the MathML
|
|
847
|
+
specification in a meaningful way are encouraged to itemize the parts
|
|
848
|
+
they leave out by referring to specific categories in the test suite.</p>
|
|
849
|
+
|
|
850
|
+
<p>For MathML-output-<phrase diff="chg">conformant</phrase> processors, there is also a <loc
|
|
851
|
+
href="http://www.w3.org/Math/validator/">MathML validator</loc>
|
|
852
|
+
accessible over the Web. Developers of MathML-output-<phrase diff="chg">conformant</phrase>
|
|
853
|
+
processors are encouraged to verify their output using this
|
|
854
|
+
validator.</p>
|
|
855
|
+
|
|
856
|
+
<p>Customers of MathML applications who wish to verify claims as to which
|
|
857
|
+
parts of the MathML specification are implemented by an application are
|
|
858
|
+
encouraged to use the test suites as a part of their decision
|
|
859
|
+
processes.</p>
|
|
860
|
+
</div4>
|
|
861
|
+
|
|
862
|
+
<div4 id="interf_deprec"><head>Deprecated MathML 1.x Features</head>
|
|
863
|
+
|
|
864
|
+
<p>MathML 2.0 contains a number of MathML 1.x features which are now
|
|
865
|
+
deprecated. The following points define what it means for a
|
|
866
|
+
feature to be deprecated, and clarify the relation between
|
|
867
|
+
deprecated features and MathML 2.0 <phrase diff="chg">conformance</phrase>.</p>
|
|
868
|
+
|
|
869
|
+
<olist>
|
|
870
|
+
<item><p>In order to be MathML-output-<phrase diff="chg">conformant</phrase>, authoring tools may not
|
|
871
|
+
generate MathML markup containing deprecated features.</p></item>
|
|
872
|
+
|
|
873
|
+
<item><p>In order to be MathML-input-<phrase diff="chg">conformant</phrase>, rendering/reading
|
|
874
|
+
tools must support deprecated features if they are to be
|
|
875
|
+
<phrase diff="chg">in conformance with MathML 1.x</phrase>. They do not have to support deprecated
|
|
876
|
+
features to be considered <phrase diff="chg">in conformance with MathML 2.0</phrase>. However, all tools
|
|
877
|
+
are encouraged to support the old forms as much as
|
|
878
|
+
possible.</p></item>
|
|
879
|
+
|
|
880
|
+
<item><p>In order to be MathML-roundtrip-<phrase diff="chg">conformant</phrase>, a processor need
|
|
881
|
+
only preserve MathML equivalence on expressions containing no
|
|
882
|
+
deprecated features.</p></item>
|
|
883
|
+
</olist>
|
|
884
|
+
|
|
885
|
+
</div4>
|
|
886
|
+
|
|
887
|
+
<div4 diff="add" id="interf_extension"><head>MathML 2.0 Extension Mechanisms and Conformance</head>
|
|
888
|
+
|
|
889
|
+
<p>MathML 2.0 defines three extension mechanisms: The <el>mglyph</el>
|
|
890
|
+
element provides a way of displaying glyphs for non-Unicode
|
|
891
|
+
characters, and glyph variants for existing Unicode characters; the
|
|
892
|
+
<el>maction</el> element uses attributes from other namespaces to obtain
|
|
893
|
+
implementation-specific parameters; and content markup makes use of
|
|
894
|
+
the <att>definitionURL</att> attribute to point to external
|
|
895
|
+
definitions of mathematical semantics.</p>
|
|
896
|
+
|
|
897
|
+
<p>These extension mechanisms are important because they provide a way
|
|
898
|
+
of encoding concepts that are beyond the scope of MathML 2.0, which
|
|
899
|
+
allows MathML to be used for exploring new ideas not yet susceptible
|
|
900
|
+
to standardization. However, as new ideas take hold, they may become
|
|
901
|
+
part of future standards. For example, an emerging character that
|
|
902
|
+
must be represented by an <el>mglyph</el> element today may be
|
|
903
|
+
assigned a Unicode codepoint in the future. At that time,
|
|
904
|
+
representing the character directly by its Unicode codepoint would be
|
|
905
|
+
preferable.</p>
|
|
906
|
+
|
|
907
|
+
<p>Because the possibility of future obsolescence is inherent in the
|
|
908
|
+
use of extension mechanisms to facilitate the discussion of new ideas,
|
|
909
|
+
MathML 2.0 makes no conformance requirement concerning the use of
|
|
910
|
+
extension mechanisms, even when alternative standard markup is
|
|
911
|
+
available. For example, using an <el>mglyph</el> element to represent
|
|
912
|
+
an 'x' is permitted. However, authors and implementors are
|
|
913
|
+
strongly encouraged to use standard markup whenever possible.
|
|
914
|
+
Similarly, maintainers of documents employing MathML 2.0 extension
|
|
915
|
+
mechanisms are encouraged to monitor relevant standards activity
|
|
916
|
+
(e.g. Unicode, OpenMath, etc) and update documents as more
|
|
917
|
+
standardized markup becomes available.</p> </div4> </div3>
|
|
918
|
+
|
|
919
|
+
<div3 id="interf_error"><head>Handling of Errors</head>
|
|
920
|
+
|
|
921
|
+
<p>If a MathML-input-<phrase diff="chg">conformant</phrase> application receives input containing one or
|
|
922
|
+
more elements with an illegal number or type of attributes or child
|
|
923
|
+
schemata, it should nonetheless attempt to render all the input in an
|
|
924
|
+
intelligible way, i.e. to render normally those parts of the input that
|
|
925
|
+
were valid, and to render error messages (rendered as if enclosed in
|
|
926
|
+
an <intref ref="presm_merror"><el>merror</el></intref>
|
|
927
|
+
element) in place of invalid expressions.</p>
|
|
928
|
+
|
|
929
|
+
<p>MathML-output-<phrase diff="chg">conformant</phrase> applications such as editors and translators may
|
|
930
|
+
choose to generate <el>merror</el> expressions to signal
|
|
931
|
+
errors in their input. This is usually preferable to generating valid, but
|
|
932
|
+
possibly erroneous, MathML.</p>
|
|
933
|
+
</div3>
|
|
934
|
+
|
|
935
|
+
<div3 id="interf_unspecified"><head>Attributes for unspecified data</head>
|
|
936
|
+
|
|
937
|
+
<p>The MathML attributes described in the MathML specification are
|
|
938
|
+
necessary for presentation and content markup. Ideally, the MathML
|
|
939
|
+
attributes should be an open-ended list so that users can add specific
|
|
940
|
+
attributes for specific renderers. However, this cannot be done within
|
|
941
|
+
the confines of a single XML DTD. Although it can be done using
|
|
942
|
+
extensions of the standard DTD, some authors will wish to use
|
|
943
|
+
non-standard attributes to take advantage of renderer-specific
|
|
944
|
+
capabilities while remaining strictly in <phrase diff="chg">conformance</phrase> with the standard
|
|
945
|
+
DTD.</p>
|
|
946
|
+
|
|
947
|
+
<p>To allow this, the MathML 1.0 specification <bibref diff="add" ref="MathML1"/>
|
|
948
|
+
allowed the attribute <att>other</att> on all elements, for use as a hook to pass
|
|
949
|
+
on renderer-specific information. In particular, it was intended as a hook for
|
|
950
|
+
passing information to audio renderers, computer algebra systems, and for pattern
|
|
951
|
+
matching in future macro/extension mechanisms. The motivation for this approach to
|
|
952
|
+
the problem was historical, looking to PostScript, for example, where comments are
|
|
953
|
+
widely used to pass information that is not part of PostScript.</p>
|
|
954
|
+
|
|
955
|
+
<p>In the meantime, however, the development of a general XML namespace
|
|
956
|
+
mechanism has made the use of the <att>other</att>
|
|
957
|
+
attribute obsolete. In MathML 2.0, the <att>other</att>
|
|
958
|
+
attribute is <intref ref="interf_deprec">deprecated</intref>
|
|
959
|
+
in favor of the use of namespace
|
|
960
|
+
prefixes to identify non-MathML attributes.</p>
|
|
961
|
+
|
|
962
|
+
<p>For example, in MathML 1.0, it was recommended that if additional information
|
|
963
|
+
was used in a renderer-specific implementation for the <el>maction</el> element (<specref ref="presm_maction"/>),
|
|
964
|
+
that information should be passed in using the <att>other</att> attribute:</p>
|
|
965
|
+
|
|
966
|
+
<eg><![CDATA[
|
|
967
|
+
<maction actiontype="highlight" other="color='#ff0000'"> expression </maction>
|
|
968
|
+
]]></eg>
|
|
969
|
+
|
|
970
|
+
<p>In MathML 2.0, a <att>color</att> attribute from another
|
|
971
|
+
namespace would be used:</p>
|
|
972
|
+
|
|
973
|
+
<eg><![CDATA[
|
|
974
|
+
<body xmlns:my="http://www.example.com/MathML/extensions">
|
|
975
|
+
...
|
|
976
|
+
<maction actiontype="highlight" my:color="#ff0000"> expression </maction>
|
|
977
|
+
...
|
|
978
|
+
</body>
|
|
979
|
+
]]></eg>
|
|
980
|
+
|
|
981
|
+
<p>Note that the intent of allowing non-standard attributes is
|
|
982
|
+
<emph>not</emph> to encourage software developers to use this as a
|
|
983
|
+
loophole for circumventing the core conventions for MathML markup.
|
|
984
|
+
Authors and applications should use non-standard attributes
|
|
985
|
+
judiciously.</p>
|
|
986
|
+
|
|
987
|
+
</div3>
|
|
988
|
+
</div2>
|
|
989
|
+
|
|
990
|
+
<div2 id="interf_future"><head>Future Extensions</head>
|
|
991
|
+
|
|
992
|
+
<p>If MathML is to remain useful in the future, it is to be expected
|
|
993
|
+
that MathML will need to be extended and revised in various ways. Some
|
|
994
|
+
of these extensions can be easily foreseen; for example, as work on
|
|
995
|
+
behavioral extensions to CSS proceeds, MathML will likely need to be
|
|
996
|
+
extended as well.</p>
|
|
997
|
+
|
|
998
|
+
<p>Similarly, there are several kinds of functionality that are fairly
|
|
999
|
+
obvious candidates for future MathML extensions. These include macros,
|
|
1000
|
+
style sheets, and perhaps a general facility for <quote>labeled
|
|
1001
|
+
diagrams</quote>. However, there will no doubt be other desirable
|
|
1002
|
+
extensions to MathML that will only emerge as MathML is widely used. For
|
|
1003
|
+
these extensions, the W3C Math Working Group relies on the extensible
|
|
1004
|
+
architecture of XML, and the common sense of the larger Web community.</p>
|
|
1005
|
+
|
|
1006
|
+
<div3><head>Macros and Style Sheets</head>
|
|
1007
|
+
|
|
1008
|
+
<p>The development of style-sheet mechanisms for XML is part of the ongoing
|
|
1009
|
+
XML activity of the World Wide Web Consortium. Both XSL and CSS are working
|
|
1010
|
+
to incorporate greater support for mathematics.</p>
|
|
1011
|
+
|
|
1012
|
+
<p>In particular, XSL Transformations <bibref ref="XSLT"/> are likely
|
|
1013
|
+
to have a large impact on the future development of MathML. Macros
|
|
1014
|
+
have traditionally contributed greatly the usability and effectiveness
|
|
1015
|
+
of mathematics encodings. Further work developing applications of
|
|
1016
|
+
XSLT tailored specifically to MathML is clearly called for.</p>
|
|
1017
|
+
|
|
1018
|
+
<p>Some of the possible uses of macro capabilities for MathML include:
|
|
1019
|
+
<glist>
|
|
1020
|
+
<gitem><label>Abbreviation</label>
|
|
1021
|
+
<def><p>One common use of macros is for
|
|
1022
|
+
abbreviation. Authors needing to repeat some complicated but constant
|
|
1023
|
+
notation can define a macro. This greatly facilitates hand authoring.
|
|
1024
|
+
Macros that allow for substitution of parameters facilitate such usage
|
|
1025
|
+
even further.</p></def>
|
|
1026
|
+
</gitem>
|
|
1027
|
+
|
|
1028
|
+
<gitem><label>Extension of Content Markup</label>
|
|
1029
|
+
<def><p>By defining macros for semantic objects, for example a binomial
|
|
1030
|
+
coefficient, or a Bessel function, one can in effect extend the content
|
|
1031
|
+
markup for MathML. Such a macro could include an explicit semantic
|
|
1032
|
+
binding, or such a binding could be easily added by an external
|
|
1033
|
+
application. Narrowly defined disciplines should be able to easily
|
|
1034
|
+
introduce standardized content markup by using standard macro packages. For
|
|
1035
|
+
example, the OpenMath project could release macro packages for attaching
|
|
1036
|
+
OpenMath content markup.</p></def>
|
|
1037
|
+
</gitem>
|
|
1038
|
+
|
|
1039
|
+
<gitem><label>Rendering and Style Control</label>
|
|
1040
|
+
<def><p>Another basic way in which macros are often used is to provide a
|
|
1041
|
+
way of controlling style and rendering behavior by replacing high-level
|
|
1042
|
+
macro definitions. This is especially important for controlling the
|
|
1043
|
+
rendering behavior of MathML content tags in a context sensitive way. Such
|
|
1044
|
+
a macro capability is also necessary to provide a way of attaching
|
|
1045
|
+
renderings to user-defined XML extensions to the MathML core.</p></def>
|
|
1046
|
+
</gitem>
|
|
1047
|
+
|
|
1048
|
+
<gitem><label>Accessibility</label>
|
|
1049
|
+
<def><p>Reader-controlled style sheets are important in providing
|
|
1050
|
+
accessibility to MathML. For example, a reader listening to a voice
|
|
1051
|
+
renderer might, by default, hear a bit of MathML presentation markup read as
|
|
1052
|
+
<quote>D sub x sup 2 of f</quote>. Knowing the context to be multi-variable
|
|
1053
|
+
calculus, the reader may wish to use a style sheet or macro package that
|
|
1054
|
+
instructs the renderer to render this <el role="starttag">msubsup</el>
|
|
1055
|
+
element as <quote>second derivative with respect to x of f</quote>.</p></def>
|
|
1056
|
+
</gitem>
|
|
1057
|
+
</glist>
|
|
1058
|
+
</p>
|
|
1059
|
+
</div3>
|
|
1060
|
+
|
|
1061
|
+
<div3><head>XML Extensions to MathML</head>
|
|
1062
|
+
|
|
1063
|
+
<p>The set of elements and attributes specified in the MathML
|
|
1064
|
+
specification are necessary for rendering common mathematical expressions.
|
|
1065
|
+
It is recognized that not all mathematical notation is covered by this
|
|
1066
|
+
set of elements, that new notations are continually invented, and that
|
|
1067
|
+
sub-communities within mathematics often have specialized notations;
|
|
1068
|
+
and furthermore that the explicit extension of a standard is a
|
|
1069
|
+
necessarily slow and conservative process. This implies that the
|
|
1070
|
+
MathML standard could never explicitly cover all the presentational
|
|
1071
|
+
forms used by every sub-community of authors and readers of
|
|
1072
|
+
mathematics, much less encode all mathematical content.</p>
|
|
1073
|
+
|
|
1074
|
+
<p>In order to facilitate the use of MathML by the widest possible
|
|
1075
|
+
audience, and to enable its smooth evolution to encompass more
|
|
1076
|
+
notational forms and more mathematical content (perhaps eventually
|
|
1077
|
+
covered by explicit extensions to the standard), the set of tags and
|
|
1078
|
+
attributes is open-ended, in the sense described in this section.</p>
|
|
1079
|
+
|
|
1080
|
+
<p>MathML is described by an XML DTD, which necessarily limits the elements
|
|
1081
|
+
and attributes to those occurring in the DTD. Renderers desiring to accept
|
|
1082
|
+
non-standard elements or attributes, and authors desiring to include these
|
|
1083
|
+
in documents, should accept or produce documents that conform to an
|
|
1084
|
+
appropriately extended XML DTD that has the standard MathML DTD
|
|
1085
|
+
as a subset.</p>
|
|
1086
|
+
|
|
1087
|
+
<p>MathML<phrase diff="del">-compliant</phrase> renderers are allowed, but not required, to accept
|
|
1088
|
+
non-standard elements and attributes, and to render them in any way. If a
|
|
1089
|
+
renderer does not accept some or all non-standard tags, it is encouraged
|
|
1090
|
+
either to handle them as errors as described above for elements with the
|
|
1091
|
+
wrong number of arguments, or to render their arguments as if they were
|
|
1092
|
+
arguments to an <el>mrow</el>, in either case rendering all
|
|
1093
|
+
standard parts of the input in the normal way.</p>
|
|
1094
|
+
</div3>
|
|
1095
|
+
</div2>
|
|
1096
|
+
</div1>
|