File: chapter5.xml.html

package info (click to toggle)
w3-recs 20110107-1
  • links: PTS, VCS
  • area: non-free
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 195,972 kB
  • ctags: 48,964
  • sloc: xml: 67,284; makefile: 115; perl: 31
file content (1372 lines) | stat: -rw-r--r-- 70,110 bytes parent folder | download
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
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html
  SYSTEM "mathml.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title>Mixing Markup Languages for Mathematical Expressions</title><style type="text/css">

.egmeta {
color:#5555AA;font-style:italic;font-family:serif;font-weight:bold;
}

table.syntax {
font-size: 75%;
background-color: #DDDDDD;
border: thin  solid;
}
table.syntax td {
border: solid thin;
}
table.syntax th {
text-align: left;
}

table.attributes td { padding-left:0.5em; padding-right:0.5em; }
table.attributes td.attname { white-space:nowrap; vertical-align:top;}
table.attributes td.attdesc { background-color:#F0F0FF; padding-left:2em; padding-right:2em}

th.uname {font-size: 50%; text-align:left;}
code           { font-family: monospace; }

div.constraint,
div.issue,
div.note,
div.notice     { margin-left: 2em; }

li p           { margin-top: 0.3em;
                 margin-bottom: 0.3em; }

div.exampleInner pre { margin-left: 1em;
                       margin-top: 0em; margin-bottom: 0em}
div.exampleOuter {border: 4px double gray;
                  margin: 0em; padding: 0em}
div.exampleInner { background-color: #d5dee3;
                   border-top-width: 4px;
                   border-top-style: double;
                   border-top-color: #d3d3d3;
                   border-bottom-width: 4px;
                   border-bottom-style: double;
                   border-bottom-color: #d3d3d3;
                   padding: 4px; margin: 0em }
div.exampleWrapper { margin: 4px }
div.exampleHeader { font-weight: bold;
                    margin: 4px}
a.mainindex {font-weight: bold;}
li.sitem {list-style-type: none;}

  .error { color: red }

  div.mathml-example {border:solid thin black;
              padding: 0.5em;
              margin: 0.5em 0 0.5em 0;
             }
  div.strict-mathml-example {border:solid thin black;
              padding: 0.5em;
              margin: 0.5em 0 0.5em 0;
             }
  div.strict-mathml-example h5 {
  margin-top: -0.3em;
  margin-bottom: -0.5em;}
  var.meta {background-color:green}
  var.transmeta {background-color:red}
  pre.mathml {padding: 0.5em;
              background-color: #FFFFDD;}
  pre.mathml-fragment {padding: 0.5em;
              background-color: #FFFFDD;}
  pre.strict-mathml {padding: 0.5em;
              background-color: #FFFFDD;}
  .minitoc { border-style: solid;
             border-color: #0050B2; 
             border-width: 1px ;
             padding: 0.3em;}
  .attention { border-style: solid; 
               border-width: 1px ; 
               color: #5D0091;
               background: #F9F5DE; 
               border-color: red;
               margin-left: 1em;
               margin-right: 1em;
               margin-top: 0.25em;
               margin-bottom: 0.25em; }

  .attribute-Name { background: #F9F5C0; }
  .method-Name { background: #C0C0F9; }
  .IDL-definition { border-style: solid; 
               border-width: 1px ; 
               color: #001000;
               background: #E0FFE0; 
               border-color: #206020;
               margin-left: 1em;
               margin-right: 1em;
               margin-top: 0.25em;
               margin-bottom: 0.25em; }
  .baseline {vertical-align: baseline}

  #eqnoc1 {width: 10%}
  #eqnoc2 {width: 80%; text-align: center; }
  #eqnoc3 {width: 10%; text-align: right; }

div.div1 {margin-bottom: 1em;}
          
.h3style {
  text-align: left;
  font-family: sans-serif;
  font-weight: normal;
  color: #0050B2; 
  font-size: 125%;
}

  h4 { text-align: left;
       font-family: sans-serif;
       font-weight: normal;
       color: #0050B2; }
  h5 { text-align: left;
       font-family: sans-serif;
       font-weight: bold;
       color: #0050B2; } 

  th {background:  #E0FFE0;}

  p, blockquote, h4 { font-family: sans-serif; }
  dt, dd, dl, ul, li { font-family: sans-serif; }
  pre, code { font-family: monospace }

  a.termref {
  text-decoration: none;
  color: black;
  }


.mathml-render {
font-family: serif;
font-size: 130%;
border: solid 4px green;
padding-left: 1em;
padding-right: 1em;
}
</style><link rel="stylesheet" type="text/css"
            href="../../../StyleSheets/TR/W3C-REC.css" />
   </head>
   <body>
      
      <h1><a id="mixing"></a>5 Mixing Markup Languages for Mathematical Expressions
      </h1>
      <!-- TOP NAVIGATION BAR -->
      <div class="minitoc">
         
         Overview: <a href="Overview.xml.html">Mathematical Markup Language (MathML) Version 3.0</a><br class="html-compat" />
         Previous: 4 <a href="chapter4.xml.html">Content Markup</a><br class="html-compat" />
         Next: 6 <a href="chapter6.xml.html">Interactions with the Host Environment</a><br class="html-compat" /><br class="html-compat" />5 <a href="chapter5.xml.html">Mixing Markup Languages for Mathematical Expressions</a><br class="html-compat" />    5.1 <a href="chapter5.xml.html#mixing.semantic.annotations">Annotation Framework</a><br class="html-compat" />        5.1.1 <a href="chapter5.xml.html#mixing.annotation.elements">Annotation elements</a><br class="html-compat" />        5.1.2 <a href="chapter5.xml.html#mixing.annotation.keys">Annotation keys</a><br class="html-compat" />        5.1.3 <a href="chapter5.xml.html#mixing.alternate.representations">Alternate representations</a><br class="html-compat" />        5.1.4 <a href="chapter5.xml.html#mixing.content.equiv">Content equivalents</a><br class="html-compat" />        5.1.5 <a href="chapter5.xml.html#mixing.annotation.references">Annotation references</a><br class="html-compat" />    5.2 <a href="chapter5.xml.html#mixing.semantic.elements">Elements for Semantic Annotations</a><br class="html-compat" />        5.2.1 <a href="chapter5.xml.html#mixing.elements.semantics">The <code>semantics</code> element</a><br class="html-compat" />            5.2.1.1 <a href="chapter5.xml.html#id.5.2.1.1">Description</a><br class="html-compat" />            5.2.1.2 <a href="chapter5.xml.html#id.5.2.1.2">Attributes</a><br class="html-compat" />        5.2.2 <a href="chapter5.xml.html#mixing.elements.annotation">The <code>annotation</code> element</a><br class="html-compat" />            5.2.2.1 <a href="chapter5.xml.html#id.5.2.2.1">Description</a><br class="html-compat" />            5.2.2.2 <a href="chapter5.xml.html#id.5.2.2.2">Attributes</a><br class="html-compat" />        5.2.3 <a href="chapter5.xml.html#mixing.elements.annotation.xml">The <code>annotation-xml</code> element</a><br class="html-compat" />            5.2.3.1 <a href="chapter5.xml.html#id.5.2.3.1">Description</a><br class="html-compat" />            5.2.3.2 <a href="chapter5.xml.html#id.5.2.3.2">Attributes</a><br class="html-compat" />    5.3 <a href="chapter5.xml.html#mixing.markup">Combining Presentation and Content Markup</a><br class="html-compat" />        5.3.1 <a href="chapter5.xml.html#mixing.pmincm">Presentation Markup in Content Markup</a><br class="html-compat" />        5.3.2 <a href="chapter5.xml.html#mixing.cminpm">Content Markup in Presentation Markup</a><br class="html-compat" />    5.4 <a href="chapter5.xml.html#mixing.parallel">Parallel Markup</a><br class="html-compat" />        5.4.1 <a href="chapter5.xml.html#mixing.top.level">Top-level Parallel Markup</a><br class="html-compat" />        5.4.2 <a href="chapter5.xml.html#mixing.cr">Parallel Markup via Cross-References</a><br class="html-compat" /></div>
      <div class="div1">
         <p>MathML markup can be combined with other markup languages, and
            these mixing constructions are realized by the semantic annotation
            elements.  The semantic annotation elements provide an important tool
            for making associations between alternate representations of an
            expression, and for associating semantic properties and other
            attributions with a MathML expression.  These elements allow
            presentation markup and content markup to be combined in several
            different ways.  One method, known as <em>mixed markup</em>, is to
            intersperse content and presentation elements in what is essentially a
            single tree.  Another method, known as <em>parallel markup</em>,
            is to provide both explicit presentation markup and content markup in
            a pair of markup expressions, combined by a single <code>semantics</code>
            element.
            
         </p>
         <div class="div2">
            
            <h2><a id="mixing.semantic.annotations"></a>5.1 Annotation Framework
            </h2>
            <p>
               An important concern of MathML is to represent associations between
               presentation and content markup forms for an expression.  Representing
               associations between MathML expressions and data of other kinds is
               also important in many contexts.  For this reason, MathML provides a
               general framework for annotation.  A MathML expression may be
               decorated with a sequence of pairs made up of a symbol that indicates
               the kind of annotation, known as the <em>annotation key</em>, and
               associated data, known as the <em>annotation value</em>.
               
            </p>
            <div class="div3">
               
               <h3><a id="mixing.annotation.elements"></a>5.1.1 Annotation elements
               </h3>
               <p>
                  The <code>semantics</code>, <code>annotation</code>, and
                  <code>annotation-xml</code> elements are used together to represent
                  annotations in MathML.  The <code>semantics</code> element provides the
                  container for a expression and its annotations.  The
                  <code>annotation</code> element is the container for text
                  annotations, and the <code>annotation-xml</code> element is used for XML
                  annotations. The <code>semantics</code> element contains the expression
                  being annotated as its first child, followed by a sequence of zero or
                  more <code>annotation</code> and/or <code>annotation-xml</code> elements.
                  
               </p>
               <table>
                  <tr>
                     <td><pre class="mathml">&lt;semantics&gt;
  &lt;mrow&gt;
    &lt;mrow&gt;
      &lt;mi&gt;sin&lt;/mi&gt;
      &lt;mo&gt;&amp;#x2061;<span style="color:#999900">&lt;!--FUNCTION APPLICATION--&gt;</span>&lt;/mo&gt;
      &lt;mfenced&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/mfenced&gt;
    &lt;/mrow&gt;
    &lt;mo&gt;+&lt;/mo&gt;
    &lt;mn&gt;5&lt;/mn&gt;
  &lt;/mrow&gt;
  &lt;annotation encoding="application/x-tex"&gt;
    \sin x + 5
  &lt;/annotation&gt;
  &lt;annotation-xml encoding="application/openmath+xml"&gt;
    &lt;OMA xmlns="http://www.openmath.org/OpenMath"&gt;
      &lt;OMS cd="arith1" name="plus"/&gt;
      &lt;OMA&gt;&lt;OMS cd="transc1" name="sin"/&gt;&lt;OMV name="x"/&gt;&lt;/OMA&gt;
      &lt;OMI&gt;5&lt;/OMI&gt;
    &lt;/OMA&gt;
  &lt;/annotation-xml&gt;
&lt;/semantics&gt;</pre></td>
                     <td class="mathml-render" valign="middle">
                        <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics>
  <mrow>
    <mrow>
      <mi>sin</mi>
      <mo>&ApplyFunction;</mo>
      <mfenced><mi>x</mi></mfenced>
    </mrow>
    <mo>+</mo>
    <mn>5</mn>
  </mrow>
  <annotation encoding="application/x-tex">
    \sin x + 5
  </annotation>
  <annotation-xml encoding="application/openmath+xml">
    <OMA xmlns="http://www.openmath.org/OpenMath">
      <OMS cd="arith1" name="plus"/>
      <OMA><OMS cd="transc1" name="sin"/><OMV name="x"/></OMA>
      <OMI>5</OMI>
    </OMA>
  </annotation-xml>
</semantics></math>
                     </td>
                  </tr>
               </table>
               <p>The <code>semantics</code> element is considered to be both a presentation
                  element and a content element, and may be used in either context.
                  All MathML processors should process the <code>semantics</code> element,
                  even if they only process one of these two subsets of MathML.
                  
               </p>
            </div>
            <div class="div3">
               
               <h3><a id="mixing.annotation.keys"></a>5.1.2 Annotation keys
               </h3>
               <p>An <em>annotation key</em> specifies the relationship between an
                  expression and an annotation. Many kinds of relationships are possible.
                  Examples include alternate representations, specification or clarification
                  of semantics, type information, rendering hints, and private data
                  intended for specific processors.  The annotation key is the primary
                  means by which a processor determines whether or not to process an
                  annotation.
               </p>
               <p>The logical relationship between an expression and an annotation
                  can have a significant impact on the proper processing of the
                  expression.  For example, a particular annotation form, called <em>semantic  
                     attributions</em>, cannot be ignored without altering the meaning
                  of the annotated expression, at  
                  least in some processing contexts. On the other hand, alternate
                  representations do not alter the meaning of an expression, but may
                  alter the presentation of the expression as they are frequently used
                  to provide rendering hints.  Still other annotations carry private data or
                  metadata that are useful in a specific context, but do not alter either
                  the semantics or the presentation of the expression.
               </p>
               <p>In MathML 3, annotation keys are defined as symbols in <a href="chapter4.xml.html#contm.cds">Content Dictionaries</a>, and are specified using
                  of the <code>cd</code> and <code>name</code> attributes on the
                  <code>annotation</code> and <code>annotation-xml</code> elements.  For backward
                  compatibility with MathML 2, an annotation key may also be referenced
                  using the <code>definitionURL</code> attribute as an alternative to the
                  <code>cd</code> and <code>name</code> attributes.  Further details on
                  referencing symbols in Content Dictionaries are discussed in <a href="chapter4.xml.html#contm.csymbol">Section 4.2.3 Content Symbols <code>&lt;csymbol&gt;</code></a>.  The symbol definition in a Content Dictionary
                  for an annotation key may have a <code>role</code> property.  Two
                  particular roles are relevant for annotations:  a role of
                  "attribution" identifies a generic annotation that can
                  be ignored without altering the meaning of the annotated term, and a
                  role of "semantic-attribution" indicates that the annotation
                  is a semantic annotation, that is, the annotation cannot be ignored
                  without potentially altering the meaning of the expression.
                  
               </p>
               <p>MathML 3 provides two predefined annotation keys for the most common
                  kinds of annotations: <a href="http://www.openmath.org/cd/mathmlkeys.xhtml#alternate-representation">alternate-representation</a> and <a href="http://www.openmath.org/cd/mathmlkeys.xhtml#contentequiv">contentequiv</a> defined in the <a href="http://www.openmath.org/cd/mathmlkeys.xhtml">mathmlkeys</a> content
                  dictionary. The <a href="http://www.openmath.org/cd/mathmlkeys.xhtml#alternate-representation">alternate-representation</a> annotation key specifies that the
                  annotation value provides an alternate representation for an
                  expression in some other markup language, and the <a href="http://www.openmath.org/cd/mathmlkeys.xhtml#contentequiv">contentequiv</a> annotation key specifies that
                  the annotation value provides a semantically equivalent alternative
                  for the annotated expression.  Further details about the use of
                  these keys is given in the sections below.
               </p>
               <p>The default annotation key is <a href="http://www.openmath.org/cd/mathmlkeys.xhtml#alternate-representation">alternate-representation</a> when no annotation key is
                  explicitly specified on an <code>annotation</code> or
                  <code>annotation-xml</code> element.
               </p>
               <p>Typically, annotation keys specify only the logical nature of the
                  relationship between an expression and an annotation.  The data format
                  for an annotation is indicated with the <code>encoding</code>
                  attribute.  In MathML 2, the <code>encoding</code> attribute was the
                  primary information that a processor could use to determine whether or
                  not it could understand an annotation.  For backward compatibility,
                  processors are encouraged to examine both the annotation key and
                  <code>encoding</code> attribute.  In
                  particular, MathML 2 specified the predefined encoding values
                  <code>MathML</code>, <code>MathML-Content</code>, and
                  <code>MathML-Presentation</code>.  The <code>MathML</code> encoding
                  value is used to indicate an <code>annotation-xml</code> element contains
                  a MathML expression.  The use of the other values is more specific, as
                  discussed in following sections.
               </p>
               <p>While the predefined <a href="http://www.openmath.org/cd/mathmlkeys.xhtml#alternate-representation">alternate-representation</a> and <a href="http://www.openmath.org/cd/mathmlkeys.xhtml#contentequiv">contentequiv</a> keys cover many common use cases, user
                  communities are encouraged to define and standardize additional
                  content dictionaries as necessary.  Annotation keys in user-defined,
                  public Content Dictionaries are preferred over private encoding
                  attribute value conventions, since content dictionaries are more
                  expressive, more open and more maintainable than private encoding
                  values.  However, for backward compatibility with MathML 2, the
                  encoding attribute may also be used.
                  
               </p>
            </div>
            <div class="div3">
               
               <h3><a id="mixing.alternate.representations"></a>5.1.3 Alternate representations
               </h3>
               <p>Alternate representation annotations are most often used to
                  provide renderings for an expression, or to provide an equivalent
                  representation in another markup language.  In general, alternate
                  representation annotations do not alter the meaning of the annotated
                  expression, but may alter its presentation.
               </p>
               <p>A particularly important case is the use of a presentation MathML
                  expression to indicate a preferred rendering for a content MathML
                  expression.  This case may be represented by labeling the annotation
                  with the <code>application/mathml-presentation+xml</code> value for
                  the <code>encoding</code> attribute.  For backward compatibility with
                  MathML 2.0, this case can also be represented with the equivalent
                  <code>MathML-Presentation</code> value for the <code>encoding</code>
                  attribute.  Note that when a presentation MathML annotation is
                  present in a <code>semantics</code> element, it may be used as the
                  default rendering of the <code>semantics</code> element, instead of
                  the default rendering of the first child.
                  
               </p>
               <p>In the example below, the <code>semantics</code> element binds together
                  various alternate representations for a content MathML expression.
                  The presentation MathML annotation may be used as the
                  default rendering, while the other annotations give representations
                  in other markup languages.  Since no attribution keys are explicitly
                  specified, the default annotation key
                  <a href="http://www.openmath.org/cd/mathmlkeys.xhtml#alternate-representation">alternate-representation</a> applies
                  to each of the annotations.
                  
               </p>
               <table>
                  <tr>
                     <td><pre class="mathml">
&lt;semantics&gt;
  &lt;apply&gt;
    &lt;plus/&gt;
    &lt;apply&gt;&lt;sin/&gt;&lt;ci&gt;x&lt;/ci&gt;&lt;/apply&gt;
    &lt;cn&gt;5&lt;/cn&gt;
  &lt;/apply&gt;
  &lt;annotation-xml encoding="MathML-Presentation"&gt;
    &lt;mrow&gt;
      &lt;mrow&gt;
        &lt;mi&gt;sin&lt;/mi&gt;
        &lt;mo&gt;&amp;#x2061;<span style="color:#999900">&lt;!--FUNCTION APPLICATION--&gt;</span>&lt;/mo&gt;
        &lt;mfenced open="(" close=")"&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/mfenced&gt;
      &lt;/mrow&gt;
      &lt;mo&gt;+&lt;/mo&gt;
      &lt;mn&gt;5&lt;/mn&gt;
    &lt;/mrow&gt;
  &lt;/annotation-xml&gt;
  &lt;annotation encoding="application/x-maple"&gt;
    sin(x) + 5
  &lt;/annotation&gt;
  &lt;annotation encoding="application/vnd.wolfram.mathematica"&gt;
    Sin[x] + 5
  &lt;/annotation&gt;
  &lt;annotation encoding="application/x-tex"&gt;
    \sin x + 5
  &lt;/annotation&gt;
  &lt;annotation-xml encoding="application/openmath+xml"&gt;
    &lt;OMA xmlns="http://www.openmath.org/OpenMath"&gt;
      &lt;OMA&gt;
        &lt;OMS cd="arith1" name="plus"/&gt;
        &lt;OMA&gt;&lt;OMS cd="transc1" name="sin"/&gt;&lt;OMV name="x"/&gt;&lt;/OMA&gt;
        &lt;OMI&gt;5&lt;/OMI&gt;
      &lt;/OMA&gt;
    &lt;/OMA&gt;
  &lt;/annotation-xml&gt;
&lt;/semantics&gt;</pre></td>
                     <td class="mathml-render" valign="middle">
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
<semantics>
  <apply>
    <plus/>
    <apply><sin/><ci>x</ci></apply>
    <cn>5</cn>
  </apply>
  <annotation-xml encoding="MathML-Presentation">
    <mrow>
      <mrow>
        <mi>sin</mi>
        <mo>&ApplyFunction;</mo>
        <mfenced open="(" close=")"><mi>x</mi></mfenced>
      </mrow>
      <mo>+</mo>
      <mn>5</mn>
    </mrow>
  </annotation-xml>
  <annotation encoding="application/x-maple">
    sin(x) + 5
  </annotation>
  <annotation encoding="application/vnd.wolfram.mathematica">
    Sin[x] + 5
  </annotation>
  <annotation encoding="application/x-tex">
    \sin x + 5
  </annotation>
  <annotation-xml encoding="application/openmath+xml">
    <OMA xmlns="http://www.openmath.org/OpenMath">
      <OMA>
        <OMS cd="arith1" name="plus"/>
        <OMA><OMS cd="transc1" name="sin"/><OMV name="x"/></OMA>
        <OMI>5</OMI>
      </OMA>
    </OMA>
  </annotation-xml>
</semantics></math>
                     </td>
                  </tr>
               </table>
            </div>
            <div class="div3">
               
               <h3><a id="mixing.content.equiv"></a>5.1.4 Content equivalents
               </h3>
               <p>Content equivalent annotations provide additional computational
                  information about an expression.  Annotations with the
                  <a href="http://www.openmath.org/cd/mathmlkeys.xhtml#contentequiv">contentequiv</a> key cannot be ignored
                  without potentially changing the behavior of an expression.
               </p>
               <p>An important case arises when a content MathML annotation is used
                  to disambiguate the meaning of a presentation MathML expression.
                  This case may be represented by labeling the annotation with the
                  <code>application/mathml-content+xml</code> value for the
                  <code>encoding</code> attribute.  In
                  MathML 2, this type of annotation was represented with the equivalent
                  <code>MathML-Content</code> value for the <code>encoding</code> attribute,
                  so processors are urged to support this usage for backward compatibility.
                  A content MathML annotation, whether in MathML 2 or 3, may be used for
                  other purposes as well, such as for other kinds of semantic assertions.
                  Consequently, in MathML 3, the
                  <a href="http://www.openmath.org/cd/mathmlkeys.xhtml#contentequiv">contentequiv</a> annotation key should
                  be used to make an explicit assertion that the annotation provides a
                  definitive content markup equivalent for an expression.
               </p>
               <p>In the example below, an ambiguous presentation MathML expression
                  is annotated with a <code>MathML-Content</code> annotation clarifying
                  its precise meaning.
               </p>
               <table>
                  <tr>
                     <td><pre class="mathml">
&lt;semantics&gt;
  &lt;mrow&gt;
    &lt;mrow&gt;
      &lt;mi&gt;a&lt;/mi&gt;
      &lt;mfenced open="(" close=")"&gt;
        &lt;mrow&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mn&gt;5&lt;/mn&gt;&lt;/mrow&gt;
      &lt;/mfenced&gt;
    &lt;/mrow&gt;
  &lt;/mrow&gt;
  &lt;annotation-xml cd="mathmlkeys" name="contentequiv"
                  encoding="MathML-Content"&gt;
    &lt;apply&gt;
      &lt;ci&gt;a&lt;/ci&gt;
      &lt;apply&gt;&lt;plus/&gt;&lt;ci&gt;x&lt;/ci&gt;&lt;cn&gt;5&lt;/cn&gt;&lt;/apply&gt;
    &lt;/apply&gt;
  &lt;/annotation-xml&gt;
&lt;/semantics&gt;</pre></td>
                     <td class="mathml-render" valign="middle">
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
<semantics>
  <mrow>
    <mrow>
      <mi>a</mi>
      <mfenced open="(" close=")">
        <mrow><mi>x</mi><mo>+</mo><mn>5</mn></mrow>
      </mfenced>
    </mrow>
  </mrow>
  <annotation-xml cd="mathmlkeys" name="contentequiv"
                  encoding="MathML-Content">
    <apply>
      <ci>a</ci>
      <apply><plus/><ci>x</ci><cn>5</cn></apply>
    </apply>
  </annotation-xml>
</semantics></math>
                     </td>
                  </tr>
               </table>
            </div>
            <div class="div3">
               
               <h3><a id="mixing.annotation.references"></a>5.1.5 Annotation references
               </h3>
               <p>In the usual case, each annotation element includes either character data
                  content (in the case of <code>annotation</code>) or XML markup data (in the case
                  of <code>annotation-xml</code>) that represents the <em>annotation value</em>.
                  There is no restriction on the type of annotation that may appear within a
                  <code>semantics</code> element.  For example, an annotation could provide a
                  T<sub>E</sub>X encoding, a linear input form for a computer algebra system,
                  a rendered image, or detailed mathematical type information.
               </p>
               <p>In some cases the alternative children of a <code>semantics</code> element
                  are not an essential part of the behavior of the annotated expression, but
                  may be useful to specialized processors.  To enable the availability of
                  several annotation formats in a more efficient manner, a <code>semantics</code>
                  element may contain empty <code>annotation</code> and <code>annotation-xml</code>
                  elements that provide <code>encoding</code> and <code>src</code> attributes
                  to specify an external location for the annotation value associated with
                  the annotation.  This type of annotation is known as an <em>annotation
                     reference</em>.
               </p><pre class="mathml-fragment">
&lt;semantics&gt;
  &lt;mfrac&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mrow&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/mrow&gt;&lt;/mfrac&gt;
  &lt;annotation encoding="image/png" src="333/formula56.png"/&gt;
  &lt;annotation encoding="application/x-maple" src="333/formula56.ms"/&gt;
&lt;/semantics&gt;</pre><p>Processing agents that anticipate that consumers of exported markup may
                  not be able to retrieve the external entity referenced by such annotations
                  should request the content of the external entity at the indicated location
                  and replace the annotation with its expanded form.
               </p>
               <p>An annotation reference follows the same rules as for other annotations
                  to determine the annotation key that specifies the relationship between
                  the annotated object and the annotation value.
               </p>
            </div>
         </div>
         <div class="div2">
            
            <h2><a id="mixing.semantic.elements"></a>5.2 Elements for Semantic Annotations
            </h2>
            <p>This section explains the semantic mapping elements <code>semantics</code>,
               <code>annotation</code>, and <code>annotation-xml</code>.  These elements associate
               alternate representations for a presentation or content expression, or
               associate semantic or other attributions that may modify the meaning of
               the annotated expression.
            </p>
            <div class="div3">
               
               <h3><a id="mixing.elements.semantics"></a>5.2.1 The <code>semantics</code> element
               </h3>
               <div class="div4">
                  
                  <h4><a id="id.5.2.1.1"></a>5.2.1.1 Description
                  </h4>
                  <p>The <code>semantics</code> element is the container element that
                     associates annotations with a MathML expression.  The
                     <code>semantics</code> element has as its first child the expression to be
                     annotated.  Any MathML expression may appear as the first child of the
                     <code>semantics</code> element.  Subsequent <code>annotation</code> and
                     <code>annotation-xml</code> children enclose the annotations.
                     An annotation represented in XML is enclosed in an
                     <code>annotation-xml</code> element.  An annotation represented
                     in character data is enclosed in an <code>annotation</code> element.
                  </p>
                  <p>As noted above, the <code>semantics</code> element is considered to be
                     both a presentation element and a content element, since it can act
                     as either, depending on its content.  Consequently, all MathML
                     processors should process the <code>semantics</code> element, even if they
                     process only presentation markup or only content markup.
                     
                  </p>
                  <p>The default rendering of a <code>semantics</code> element is the default
                     rendering of its first child.  A renderer may use the information contained
                     in the annotations to customize its rendering of the annotated element.
                  </p>
                  <table>
                     <tr>
                        <td><pre class="mathml">&lt;semantics&gt;
  &lt;mrow&gt;
    &lt;mrow&gt;
      &lt;mi&gt;sin&lt;/mi&gt;
      &lt;mo&gt;&amp;#x2061;<span style="color:#999900">&lt;!--FUNCTION APPLICATION--&gt;</span>&lt;/mo&gt;
      &lt;mfenced&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/mfenced&gt;
    &lt;/mrow&gt;
    &lt;mo&gt;+&lt;/mo&gt;
    &lt;mn&gt;5&lt;/mn&gt;
  &lt;/mrow&gt;
  &lt;annotation-xml cd="mathmlkeys" name="contentequiv" encoding="MathML-Content"&gt;
    &lt;apply&gt;
      &lt;plus/&gt;
      &lt;apply&gt;&lt;sin/&gt;&lt;ci&gt;x&lt;/ci&gt;&lt;/apply&gt;
      &lt;cn&gt;5&lt;/cn&gt;
    &lt;/apply&gt;
  &lt;/annotation-xml&gt;
  &lt;annotation encoding="application/x-tex"&gt;
    \sin x + 5
  &lt;/annotation&gt;
&lt;/semantics&gt;</pre></td>
                        <td class="mathml-render" valign="middle">
                           <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics>
  <mrow>
    <mrow>
      <mi>sin</mi>
      <mo>&ApplyFunction;</mo>
      <mfenced><mi>x</mi></mfenced>
    </mrow>
    <mo>+</mo>
    <mn>5</mn>
  </mrow>
  <annotation-xml cd="mathmlkeys" name="contentequiv" encoding="MathML-Content">
    <apply>
      <plus/>
      <apply><sin/><ci>x</ci></apply>
      <cn>5</cn>
    </apply>
  </annotation-xml>
  <annotation encoding="application/x-tex">
    \sin x + 5
  </annotation>
</semantics></math>
                        </td>
                     </tr>
                  </table>
               </div>
               <div class="div4">
                  
                  <h4><a id="id.5.2.1.2"></a>5.2.1.2 Attributes
                  </h4>
                  <table border="1" class="attributes">
                     <thead>
                        <tr>
                           <th>Name</th>
                           <th>values</th>
                           <th>default</th>
                        </tr>
                     </thead>
                     <tbody>
                        <tr>
                           <td rowspan="2" class="attname">definitionURL</td>
                           <td><a href="chapter2.xml.html#type.uri"><em>URI</em></a></td>
                           <td><em>none</em></td>
                        </tr>
                        <tr>
                           <td colspan="2" class="attdesc">The location of an external source for semantic information</td>
                        </tr>
                        <tr>
                           <td rowspan="2" class="attname">encoding</td>
                           <td><a href="chapter2.xml.html#type.string"><em>string</em></a></td>
                           <td><em>none</em></td>
                        </tr>
                        <tr>
                           <td colspan="2" class="attdesc">The encoding of the external semantic information</td>
                        </tr>
                     </tbody>
                  </table>
                  <p>The <code>semantics</code> element takes the <code>definitionURL</code> and
                     <code>encoding</code> attributes, which reference an external source for some
                     or all of the semantic information for the annotated element, as modified
                     by the annotation.  The use of these attributes on the <code>semantics</code>
                     element is deprecated in MathML3.
                     
                  </p>
               </div>
            </div>
            <div class="div3">
               
               <h3><a id="mixing.elements.annotation"></a>5.2.2 The <code>annotation</code> element
               </h3>
               <div class="div4">
                  
                  <h4><a id="id.5.2.2.1"></a>5.2.2.1 Description
                  </h4>
                  <p>The <code>annotation</code> element is the container element for a semantic
                     annotation whose representation is parsed character data in a non-XML
                     format.  The <code>annotation</code> element should contain the character
                     data for the annotation, and should not contain XML markup elements.
                     If the annotation contains one of the XML reserved characters
                     <code>&amp;</code>, <code>&lt;</code>, <code>&gt;</code>,
                     <code>'</code>, or <code>"</code>, then these characters must
                     be encoded using an XML entity reference or an XML <code>CDATA</code>
                     section.
                  </p>
               </div>
               <div class="div4">
                  
                  <h4><a id="id.5.2.2.2"></a>5.2.2.2 Attributes
                  </h4>
                  <table border="1" class="attributes">
                     <thead>
                        <tr>
                           <th>Name</th>
                           <th>values</th>
                           <th>default</th>
                        </tr>
                     </thead>
                     <tbody>
                        <tr>
                           <td rowspan="2" class="attname">definitionURL</td>
                           <td><a href="chapter2.xml.html#type.uri"><em>URI</em></a></td>
                           <td><em>none</em></td>
                        </tr>
                        <tr>
                           <td colspan="2" class="attdesc">The location of the annotation key symbol</td>
                        </tr>
                        <tr>
                           <td rowspan="2" class="attname">encoding</td>
                           <td><a href="chapter2.xml.html#type.string"><em>string</em></a></td>
                           <td><em>none</em></td>
                        </tr>
                        <tr>
                           <td colspan="2" class="attdesc">The encoding of the semantic information in the annotation</td>
                        </tr>
                        <tr>
                           <td rowspan="2" class="attname">cd</td>
                           <td><a href="chapter2.xml.html#type.string"><em>string</em></a></td>
                           <td>mathmlkeys</td>
                        </tr>
                        <tr>
                           <td colspan="2" class="attdesc">The content dictionary that contains the annotation key symbol</td>
                        </tr>
                        <tr>
                           <td rowspan="2" class="attname">name</td>
                           <td><a href="chapter2.xml.html#type.string"><em>string</em></a></td>
                           <td>alternate-representation</td>
                        </tr>
                        <tr>
                           <td colspan="2" class="attdesc">The name of the annotation key symbol</td>
                        </tr>
                        <tr>
                           <td rowspan="2" class="attname">src</td>
                           <td><a href="chapter2.xml.html#type.uri"><em>URI</em></a></td>
                           <td><em>none</em></td>
                        </tr>
                        <tr>
                           <td colspan="2" class="attdesc">The location of an external source for semantic information</td>
                        </tr>
                     </tbody>
                  </table>
                  <p>Taken together, the <code>cd</code> and <code>name</code> attributes
                     specify the annotation key symbol, which identifies the relationship
                     between the annotated element and the annotation, as described in
                     <a href="chapter5.xml.html#mixing.annotation.elements">Section 5.1.1 Annotation elements</a>. The <code>definitionURL</code>
                     attribute provides an alternate way to reference the annotation key
                     symbol as a single attribute.  If none of these attributes are present,
                     the annotation key symbol is the symbol
                     <a href="http://www.openmath.org/cd/mathmlkeys.xhtml#alternate-representation">alternate-representation</a>
                     from the <a href="http://www.openmath.org/cd/mathmlkeys.xhtml">mathmlkeys</a> content dictionary.
                  </p>
                  <p>The <code>encoding</code> attribute describes the content type of the
                     annotation.  The value of the <code>encoding</code> attribute may contain
                     a media type that identifies the data format for the encoding data.  For
                     data formats that do not have an associated media type, implementors may
                     choose a self-describing character string to identify their content type.
                  </p>
                  <p>The <code>src</code> attribute provides a mechanism to attach external
                     entities as annotations on MathML expressions.
                  </p><pre class="mathml-fragment">
&lt;annotation encoding="image/png" src="333/formula56.png"/&gt;</pre><p>The <code>annotation</code> element is a semantic mapping element that may
                     only be used as a child of the <code>semantics</code> element.  While there is
                     no default rendering for the <code>annotation</code> element, a renderer may
                     use the information contained in an annotation to customize its rendering
                     of the annotated element.
                  </p>
               </div>
            </div>
            <div class="div3">
               
               <h3><a id="mixing.elements.annotation.xml"></a>5.2.3 The <code>annotation-xml</code> element
               </h3>
               <div class="div4">
                  
                  <h4><a id="id.5.2.3.1"></a>5.2.3.1 Description
                  </h4>
                  <p>The <code>annotation-xml</code> element is the container element for a
                     semantic annotation whose representation is structured markup in an XML
                     format.  The <code>annotation-xml</code> element should contain the markup
                     elements, attributes, and character data for the annotation.
                  </p>
               </div>
               <div class="div4">
                  
                  <h4><a id="id.5.2.3.2"></a>5.2.3.2 Attributes
                  </h4>
                  <table border="1" class="attributes">
                     <thead>
                        <tr>
                           <th>Name</th>
                           <th>values</th>
                           <th>default</th>
                        </tr>
                     </thead>
                     <tbody>
                        <tr>
                           <td rowspan="2" class="attname">definitionURL</td>
                           <td><a href="chapter2.xml.html#type.uri"><em>URI</em></a></td>
                           <td><em>none</em></td>
                        </tr>
                        <tr>
                           <td colspan="2" class="attdesc">The location of the annotation key symbol</td>
                        </tr>
                        <tr>
                           <td rowspan="2" class="attname">encoding</td>
                           <td><a href="chapter2.xml.html#type.string"><em>string</em></a></td>
                           <td><em>none</em></td>
                        </tr>
                        <tr>
                           <td colspan="2" class="attdesc">The encoding of the semantic information in the annotation</td>
                        </tr>
                        <tr>
                           <td rowspan="2" class="attname">cd</td>
                           <td><a href="chapter2.xml.html#type.string"><em>string</em></a></td>
                           <td>mathmlkeys</td>
                        </tr>
                        <tr>
                           <td colspan="2" class="attdesc">The content dictionary that contains the annotation key symbol</td>
                        </tr>
                        <tr>
                           <td rowspan="2" class="attname">name</td>
                           <td><a href="chapter2.xml.html#type.string"><em>string</em></a></td>
                           <td>alternate-representation</td>
                        </tr>
                        <tr>
                           <td colspan="2" class="attdesc">The name of the annotation key symbol</td>
                        </tr>
                        <tr>
                           <td rowspan="2" class="attname">src</td>
                           <td><a href="chapter2.xml.html#type.uri"><em>URI</em></a></td>
                           <td><em>none</em></td>
                        </tr>
                        <tr>
                           <td colspan="2" class="attdesc">The location of an external source for semantic information</td>
                        </tr>
                     </tbody>
                  </table>
                  <p>Taken together, the <code>cd</code> and <code>name</code> attributes
                     specify the annotation key symbol, which identifies the relationship
                     between the annotated element and the annotation, as described in
                     <a href="chapter5.xml.html#mixing.annotation.elements">Section 5.1.1 Annotation elements</a>. The <code>definitionURL</code>
                     attribute provides an alternate way to reference the annotation key
                     symbol as a single attribute.  If none of these attributes are present,
                     the annotation key symbol is the symbol
                     <a href="http://www.openmath.org/cd/mathmlkeys.xhtml#alternate-representation">alternate-representation</a>
                     from the <a href="http://www.openmath.org/cd/mathmlkeys.xhtml">mathmlkeys</a> content dictionary.
                  </p>
                  <p>The <code>encoding</code> attribute describes the content type of the
                     annotation.  The value of the <code>encoding</code> attribute may contain
                     a media type that identifies the data format for the encoding data.  For
                     data formats that do not have an associated media type, implementors may
                     choose a self-describing character string to identify their content type.
                     In particular, as described above and in <a href="chapter6.xml.html#encoding-names">Section 6.2.3 Names of MathML Encodings</a>, MathML specifies
                     <code>MathML</code>, <code>MathML-Presentation</code>, and
                     <code>MathML-Content</code> as predefined values for the
                     <code>encoding</code> attribute.   Finally, The <code>src</code>
                     attribute provides a mechanism to attach external XML entities as
                     annotations on MathML expressions.
                  </p><pre class="mathml-fragment">&lt;annotation-xml cd="mathmlkeys" name="contentequiv" encoding="MathML-Content"&gt;
  &lt;apply&gt;
    &lt;plus/&gt;
    &lt;apply&gt;&lt;sin/&gt;&lt;ci&gt;x&lt;/ci&gt;&lt;/apply&gt;
    &lt;cn&gt;5&lt;/cn&gt;
  &lt;/apply&gt;
&lt;/annotation-xml&gt;

&lt;annotation-xml encoding="application/openmath+xml"&gt;
  &lt;OMA xmlns="http://www.openmath.org/OpenMath"&gt;
    &lt;OMS cd="arith1" name="plus"/&gt;
    &lt;OMA&gt;&lt;OMS cd="transc1" name="sin"/&gt;&lt;OMV name="x"/&gt;&lt;/OMA&gt;
    &lt;OMI&gt;5&lt;/OMI&gt;
  &lt;/OMA&gt;
&lt;/annotation-xml&gt;</pre><p>When the annotation value is represented in an XML dialect other than MathML, the
                     namespace for the XML markup for the annotation should be identified by means of namespace
                     attributes and/or namespace prefixes on the annotation value.  For instance:
                  </p><pre class="mathml-fragment">
&lt;annotation-xml encoding="application/xhtml+xml"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
    &lt;head&gt;&lt;title&gt;E&lt;/title&gt;&lt;/head&gt;
    &lt;body&gt;
      &lt;p&gt;The base of the natural logarithms, approximately 2.71828.&lt;/p&gt;
    &lt;/body&gt;
  &lt;/html&gt;
&lt;/annotation-xml&gt;</pre><p>The <code>annotation-xml</code> element is a semantic mapping element that may only be used
                     as a child of the <code>semantics</code> element.  While there is no default rendering for the
                     <code>annotation-xml</code> element, a renderer may use the information contained in an
                     annotation to customize its rendering of the annotated element.
                  </p>
               </div>
            </div>
         </div>
         <div class="div2">
            
            <h2><a id="mixing.markup"></a>5.3 Combining Presentation and Content Markup
            </h2>
            <p>
               Presentation markup encodes the <em>notational structure</em> of an expression.
               Content markup encodes the <em>functional structure</em> of an expression.  In certain
               cases, a particular application of MathML may require a combination of both presentation
               and content markup.  This section describes specific constraints that govern the use of
               presentation markup within content markup, and vice versa.
               
            </p>
            <div class="div3">
               
               <h3><a id="mixing.pmincm"></a>5.3.1 Presentation Markup in Content Markup
               </h3>
               <p>
                  Presentation markup may be embedded within content markup so long as the
                  resulting expression retains an unambiguous function application structure.
                  
                  Specifically, presentation markup may only appear in content markup
                  in three ways:
                  
               </p>
               <ol type="1">
                  <li>
                     <p>within <code>ci</code> and <code>cn</code> token elements
                     </p>
                  </li>
                  <li>
                     <p>within the <code>csymbol</code> element
                     </p>
                  </li>
                  <li>
                     <p>within the <code>semantics</code> element
                     </p>
                  </li>
               </ol>
               <p>
                  Any other presentation markup occurring within content markup is a
                  MathML error.  More detailed discussion of these three cases follows:
                  
               </p>
               <dl>
                  <dt class="label">Presentation markup within token elements.</dt>
                  <dd>The token elements <code>ci</code> and <code>cn</code> are permitted to
                     contain any sequence of MathML characters (defined in <a href="chapter7.xml.html">Chapter 7 Characters, Entities and Fonts</a>)
                     and/or presentation elements.  Contiguous blocks of MathML characters in
                     <code>ci</code> or <code>cn</code> elements are treated as if wrapped in
                     <code>mi</code> or <code>mn</code> elements, as appropriate, and the resulting
                     collection of presentation elements is rendered as if wrapped in an
                     implicit <code>mrow</code> element.
                  </dd>
                  <dt class="label">Presentation markup within the <code>csymbol</code> element.
                  </dt>
                  <dd>The <code>csymbol</code> element may contain either MathML characters
                     interspersed with presentation markup, or content markup.  It is a MathML
                     error for a <code>csymbol</code> element to contain both presentation and
                     content elements.  When the <code>csymbol</code> element contains
                     character data and presentation markup, the same rendering rules that apply
                     to the token elements <code>ci</code> and <code>cn</code> should be used.
                  </dd>
                  <dt class="label">Presentation markup within the <code>semantics</code> element.
                  </dt>
                  <dd>One of the main purposes of the <code>semantics</code> element is to
                     provide a mechanism for incorporating arbitrary MathML expressions into
                     content markup in a semantically meaningful way.  In particular, any valid
                     presentation expression can be embedded in a content expression by placing
                     it as the first child of a <code>semantics</code> element.  The meaning of this
                     wrapped expression should be indicated by one or more annotation elements
                     also contained in the <code>semantics</code> element.
                  </dd>
               </dl>
            </div>
            <div class="div3">
               
               <h3><a id="mixing.cminpm"></a>5.3.2 Content Markup in Presentation Markup
               </h3>
               <p>
                  Content markup may be embedded within presentation markup so long as the
                  resulting expression has an unambiguous rendering.  That is, it must be
                  possible, in principle, to produce a presentation markup fragment for
                  each content markup fragment that appears in the combined expression.
                  The replacement of each content markup fragment by its corresponding
                  presentation markup should produce a well-formed presentation markup
                  expression.  A presentation engine should then be able to process this
                  presentation expression without reference to the content markup bits
                  included in the original expression.
                  
               </p>
               <p>
                  In general, this constraint means that each embedded content expression
                  must be well-formed, as a content expression, and must be able to stand
                  alone outside the context of any containing content markup element.  As
                  a result, the following content elements may not appear as an immediate
                  child of a presentation element:
                  <code>annotation</code>, <code>annotation-xml</code>,
                  <code>bvar</code>, <code>condition</code>, <code>degree</code>,
                  <code>logbase</code>, <code>lowlimit</code>, <code>uplimit</code>.
                  
               </p>
               <p>
                  In addition, within presentation markup, content markup may not appear
                  within presentation token elements.
                  
               </p>
            </div>
         </div>
         <div class="div2">
            
            <h2><a id="mixing.parallel"></a>5.4 Parallel Markup
            </h2>
            <p>
               Some applications are able to use <em>both</em> presentation
               and content information.  <em>Parallel markup</em> is a way to
               combine two or more markup trees for the same mathematical expression.
               Parallel markup is achieved with the <code>semantics</code> element.
               Parallel markup for an expression may appear on its own, or as part
               of a larger content or presentation tree.
               
            </p>
            <div class="div3">
               
               <h3><a id="mixing.top.level"></a>5.4.1 Top-level Parallel Markup
               </h3>
               <p>
                  In many cases, the goal is to provide presentation markup and content
                  markup for a mathematical expression as a whole.
                  A single <code>semantics</code> element may be used to pair two markup trees,
                  where one child element provides the presentation markup, and the
                  other child element provides the content markup.
               </p>
               <p>
                  The following example encodes the Boolean arithmetic expression
                  (<var>a</var>+<var>b</var>)(<var>c</var>+<var>d</var>) in this way.
                  
               </p>
               <table>
                  <tr>
                     <td><pre class="mathml">
&lt;semantics&gt;
  &lt;mrow&gt;
    &lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;a&lt;/mi&gt; &lt;mo&gt;+&lt;/mo&gt; &lt;mi&gt;b&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;
    &lt;mo&gt;&amp;#x2062;<span style="color:#999900">&lt;!--INVISIBLE TIMES--&gt;</span>&lt;/mo&gt;
    &lt;mrow&gt;&lt;mo&gt;(&lt;/mo&gt;&lt;mi&gt;c&lt;/mi&gt; &lt;mo&gt;+&lt;/mo&gt; &lt;mi&gt;d&lt;/mi&gt;&lt;mo&gt;)&lt;/mo&gt;&lt;/mrow&gt;
  &lt;/mrow&gt;
  &lt;annotation-xml encoding="MathML-Content"&gt;
    &lt;apply&gt;&lt;and/&gt;
      &lt;apply&gt;&lt;xor/&gt;&lt;ci&gt;a&lt;/ci&gt; &lt;ci&gt;b&lt;/ci&gt;&lt;/apply&gt;
      &lt;apply&gt;&lt;xor/&gt;&lt;ci&gt;c&lt;/ci&gt; &lt;ci&gt;d&lt;/ci&gt;&lt;/apply&gt;
    &lt;/apply&gt;
  &lt;/annotation-xml&gt;
&lt;/semantics&gt;</pre></td>
                     <td class="mathml-render" valign="middle">
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
<semantics>
  <mrow>
    <mrow><mo>(</mo><mi>a</mi> <mo>+</mo> <mi>b</mi><mo>)</mo></mrow>
    <mo>&InvisibleTimes;</mo>
    <mrow><mo>(</mo><mi>c</mi> <mo>+</mo> <mi>d</mi><mo>)</mo></mrow>
  </mrow>
  <annotation-xml encoding="MathML-Content">
    <apply><and/>
      <apply><xor/><ci>a</ci> <ci>b</ci></apply>
      <apply><xor/><ci>c</ci> <ci>d</ci></apply>
    </apply>
  </annotation-xml>
</semantics></math>
                     </td>
                  </tr>
               </table>
               <p>
                  Note that the above markup annotates the presentation markup as
                  the first child element, with the content markup as part of the
                  <code>annotation-xml</code> element.  An equivalent form could be given
                  that annotates the content markup as the first child element, with
                  the presentation markup as part of the <code>annotation-xml</code> element.
                  
               </p>
            </div>
            <div class="div3">
               
               <h3><a id="mixing.cr"></a>5.4.2 Parallel Markup via Cross-References
               </h3>
               <p>
                  To accommodate applications that must process sub-expressions of large
                  objects, MathML supports cross-references between the branches of a
                  <code>semantics</code> element to identify corresponding sub-structures.
                  These cross-references are established by the use of the <code>id</code>
                  and <code>xref</code> attributes within a <code>semantics</code> element.
                  This application of the <code>id</code> and <code>xref</code> attributes within
                  a <code>semantics</code> element should be viewed as best practice to enable
                  a recipient to select arbitrary sub-expressions in each alternative
                  branch of a <code>semantics</code> element.  The <code>id</code> and
                  <code>xref</code> attributes may be placed on MathML elements of any type.
                  
               </p>
               <p>
                  The following example demonstrates cross-references for the
                  Boolean arithmetic expression
                  (<var>a</var>+<var>b</var>)(<var>c</var>+<var>d</var>).
                  
                  
               </p>
               <table>
                  <tr>
                     <td><pre class="mathml">
&lt;semantics&gt;
  &lt;mrow id="E"&gt;
    &lt;mrow id="E.1"&gt;
      &lt;mo id="E.1.1"&gt;(&lt;/mo&gt;
      &lt;mi id="E.1.2"&gt;a&lt;/mi&gt;
      &lt;mo id="E.1.3"&gt;+&lt;/mo&gt;
      &lt;mi id="E.1.4"&gt;b&lt;/mi&gt;
      &lt;mo id="E.1.5"&gt;)&lt;/mo&gt;
    &lt;/mrow&gt;
    &lt;mo id="E.2"&gt;&amp;#x2062;<span style="color:#999900">&lt;!--INVISIBLE TIMES--&gt;</span>&lt;/mo&gt;
    &lt;mrow id="E.3"&gt;
      &lt;mo id="E.3.1"&gt;(&lt;/mo&gt;
      &lt;mi id="E.3.2"&gt;c&lt;/mi&gt;
      &lt;mo id="E.3.3"&gt;+&lt;/mo&gt;
      &lt;mi id="E.3.4"&gt;d&lt;/mi&gt;
      &lt;mo id="E.3.5"&gt;)&lt;/mo&gt;
    &lt;/mrow&gt;
  &lt;/mrow&gt;

  &lt;annotation-xml encoding="MathML-Content"&gt;
    &lt;apply xref="E"&gt;
      &lt;and xref="E.2"/&gt;
      &lt;apply xref="E.1"&gt;
        &lt;xor xref="E.1.3"/&gt;&lt;ci xref="E.1.2"&gt;a&lt;/ci&gt;&lt;ci xref="E.1.4"&gt;b&lt;/ci&gt;
      &lt;/apply&gt;
      &lt;apply xref="E.3"&gt;
        &lt;xor xref="E.3.3"/&gt;&lt;ci xref="E.3.2"&gt;c&lt;/ci&gt;&lt;ci xref="E.3.4"&gt;d&lt;/ci&gt;
      &lt;/apply&gt;
    &lt;/apply&gt;
  &lt;/annotation-xml&gt;
&lt;/semantics&gt;
</pre></td>
                     <td class="mathml-render" valign="middle">
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
<semantics>
  <mrow id="E">
    <mrow id="E.1">
      <mo id="E.1.1">(</mo>
      <mi id="E.1.2">a</mi>
      <mo id="E.1.3">+</mo>
      <mi id="E.1.4">b</mi>
      <mo id="E.1.5">)</mo>
    </mrow>
    <mo id="E.2">&InvisibleTimes;</mo>
    <mrow id="E.3">
      <mo id="E.3.1">(</mo>
      <mi id="E.3.2">c</mi>
      <mo id="E.3.3">+</mo>
      <mi id="E.3.4">d</mi>
      <mo id="E.3.5">)</mo>
    </mrow>
  </mrow>

  <annotation-xml encoding="MathML-Content">
    <apply xref="E">
      <and xref="E.2"/>
      <apply xref="E.1">
        <xor xref="E.1.3"/><ci xref="E.1.2">a</ci><ci xref="E.1.4">b</ci>
      </apply>
      <apply xref="E.3">
        <xor xref="E.3.3"/><ci xref="E.3.2">c</ci><ci xref="E.3.4">d</ci>
      </apply>
    </apply>
  </annotation-xml>
</semantics>
</math>
                     </td>
                  </tr>
               </table>
               <p>
                  An <code>id</code> attribute and associated <code>xref</code> attributes
                  that appear within the same <code>semantics</code> element establish the
                  cross-references between corresponding sub-expressions.
                  
               </p>
               <p>
                  For parallel markup, all of the <code>id</code> attributes referenced by any <code>xref</code>
                  attribute should be in the <em>same</em> branch of an enclosing
                  <code>semantics</code> element.  This constraint guarantees that the
                  cross-references do not create unintentional cycles.  This restriction
                  does <em>not</em> exclude the use of <code>id</code> attributes within
                  other branches of the enclosing <code>semantics</code> element.  It does,
                  however, exclude references to these other <code>id</code> attributes
                  originating from the same <code>semantics</code> element.
                  
               </p>
               <p>
                  There is no restriction on which branch of the <code>semantics</code> element
                  may contain the destination <code>id</code> attributes.  It is up to the
                  application to determine which branch to use.
                  
               </p>
               <p>
                  In general, there will not be a one-to-one correspondence between nodes
                  in parallel branches.  For example, a presentation tree may contain elements,
                  such as parentheses, that have no correspondents in the content tree.  It is
                  therefore often useful to put the <code>id</code> attributes on the branch with
                  the finest-grained node structure.  Then all of the other branches will have
                  <code>xref</code> attributes to some subset of the <code>id</code> attributes.
                  
               </p>
               <p>
                  In absence of other criteria, the first branch of the <code>semantics</code>
                  element is a sensible choice to contain the <code>id</code> attributes.
                  Applications that add or remove annotations will then not have to re-assign
                  these attributes as the annotations change.
                  
               </p>
               <p>
                  In general, the use of <code>id</code> and <code>xref</code> attributes allows
                  a full correspondence between sub-expressions to be given in text that is
                  at most a constant factor larger than the original.  The direction of the
                  references should not be taken to imply that sub-expression selection is
                  intended to be permitted only on one child of the <code>semantics</code> element.
                  It is equally feasible to select a subtree in any branch and
                  to recover the corresponding subtrees of the other branches.
                  
               </p>
               <p>
                  Parallel markup with cross-references may be used in any XML-encoded branch
                  of the semantic annotations, as shown by the following example where
                  the Boolean expression of the previous section is
                  annotated with OpenMath markup that includes cross-references:
                  
               </p>
               <table>
                  <tr>
                     <td><pre class="mathml">
&lt;semantics&gt;
  &lt;mrow id="EE"&gt;
    &lt;mrow id="EE.1"&gt;
      &lt;mo id="EE.1.1"&gt;(&lt;/mo&gt;
      &lt;mi id="EE.1.2"&gt;a&lt;/mi&gt;
      &lt;mo id="EE.1.3"&gt;+&lt;/mo&gt;
      &lt;mi id="EE.1.4"&gt;b&lt;/mi&gt;
      &lt;mo id="EE.1.5"&gt;)&lt;/mo&gt;
    &lt;/mrow&gt;
    &lt;mo id="EE.2"&gt;&amp;#x2062;<span style="color:#999900">&lt;!--INVISIBLE TIMES--&gt;</span>&lt;/mo&gt;
    &lt;mrow id="EE.3"&gt;
      &lt;mo id="EE.3.1"&gt;(&lt;/mo&gt;
      &lt;mi id="EE.3.2"&gt;c&lt;/mi&gt;
      &lt;mo id="EE.3.3"&gt;+&lt;/mo&gt;
      &lt;mi id="EE.3.4"&gt;d&lt;/mi&gt;
      &lt;mo id="EE.3.5"&gt;)&lt;/mo&gt;
    &lt;/mrow&gt;
  &lt;/mrow&gt;

  &lt;annotation-xml encoding="MathML-Content"&gt;
    &lt;apply xref="EE"&gt;
      &lt;and xref="EE.2"/&gt;
      &lt;apply xref="EE.1"&gt;
        &lt;xor xref="EE.1.3"/&gt;&lt;ci xref="EE.1.2"&gt;a&lt;/ci&gt;&lt;ci xref="EE.1.4"&gt;b&lt;/ci&gt;
      &lt;/apply&gt;
      &lt;apply xref="EE.3"&gt;
        &lt;xor xref="EE.3.3"/&gt;&lt;ci xref="EE.3.2"&gt;c&lt;/ci&gt;&lt;ci xref="EE.3.4"&gt;d&lt;/ci&gt;
      &lt;/apply&gt;
    &lt;/apply&gt;
  &lt;/annotation-xml&gt;

  &lt;annotation-xml encoding="application/openmath+xml"&gt;
    &lt;om:OMA xmlns:om="http://www.openmath.org/OpenMath" href="EE"&gt;
      &lt;om:OMS name="and" cd="logic1" href="EE.2"/&gt;

      &lt;om:OMA href="EE.1"&gt;
        &lt;om:OMS name="xor" cd="logic1" href="EE.1.3"/&gt;
        &lt;om:OMV name="a" href="EE.1.2"/&gt;
        &lt;om:OMV name="b" href="EE.1.4"/&gt;
      &lt;/om:OMA&gt;

      &lt;om:OMA href="EE.3"&gt;
        &lt;om:OMS name="xor" cd="logic1" href="EE.3.3"/&gt;
        &lt;om:OMV name="c" href="EE.3.2"/&gt;
        &lt;om:OMV name="d" href="EE.3.4"/&gt;
      &lt;/om:OMA&gt;
    &lt;/om:OMA&gt;
  &lt;/annotation-xml&gt;
&lt;/semantics&gt;
</pre></td>
                     <td class="mathml-render" valign="middle">
                        <math xmlns="http://www.w3.org/1998/Math/MathML">
<semantics>
  <mrow id="EE">
    <mrow id="EE.1">
      <mo id="EE.1.1">(</mo>
      <mi id="EE.1.2">a</mi>
      <mo id="EE.1.3">+</mo>
      <mi id="EE.1.4">b</mi>
      <mo id="EE.1.5">)</mo>
    </mrow>
    <mo id="EE.2">&InvisibleTimes;</mo>
    <mrow id="EE.3">
      <mo id="EE.3.1">(</mo>
      <mi id="EE.3.2">c</mi>
      <mo id="EE.3.3">+</mo>
      <mi id="EE.3.4">d</mi>
      <mo id="EE.3.5">)</mo>
    </mrow>
  </mrow>

  <annotation-xml encoding="MathML-Content">
    <apply xref="EE">
      <and xref="EE.2"/>
      <apply xref="EE.1">
        <xor xref="EE.1.3"/><ci xref="EE.1.2">a</ci><ci xref="EE.1.4">b</ci>
      </apply>
      <apply xref="EE.3">
        <xor xref="EE.3.3"/><ci xref="EE.3.2">c</ci><ci xref="EE.3.4">d</ci>
      </apply>
    </apply>
  </annotation-xml>

  <annotation-xml encoding="application/openmath+xml">
    <om:OMA xmlns:om="http://www.openmath.org/OpenMath" href="EE">
      <om:OMS name="and" cd="logic1" href="EE.2"/>

      <om:OMA href="EE.1">
        <om:OMS name="xor" cd="logic1" href="EE.1.3"/>
        <om:OMV name="a" href="EE.1.2"/>
        <om:OMV name="b" href="EE.1.4"/>
      </om:OMA>

      <om:OMA href="EE.3">
        <om:OMS name="xor" cd="logic1" href="EE.3.3"/>
        <om:OMV name="c" href="EE.3.2"/>
        <om:OMV name="d" href="EE.3.4"/>
      </om:OMA>
    </om:OMA>
  </annotation-xml>
</semantics>
</math>
                     </td>
                  </tr>
               </table>
               <p>
                  Here <code>OMA</code>, <code>OMS</code>
                  and <code>OMV</code> are elements defined in the OpenMath
                  standard for representing application, symbol, and variable, respectively. 
                  The references from the OpenMath annotation are given by the
                  <code>href</code> attributes.
                  
               </p>
            </div>
         </div>
      </div>
      <div class="minitoc">
         
         Overview: <a href="Overview.xml.html">Mathematical Markup Language (MathML) Version 3.0</a><br class="html-compat" />
         Previous:     4 <a href="chapter4.xml.html">Content Markup</a><br class="html-compat" />
         Next:     6 <a href="chapter6.xml.html">Interactions with the Host Environment</a></div>
   </body>
</html>