Top-level parallel markup

(Excerpt from "The MathML Handbook" by Pavi Sandhu)

Parallel markup that consists of a single semantics element is called top-level parallel markup. This is because it establishes a correspondence between the content encoding and presentation encoding of the main top-level expression.

To specify a particular rendering for a given piece of content markup, you would specify a content expression as the first argument of the semantics element and the corresponding presentation expression as the second argument. Here is an example:

Top-level parallel markup: example 1

<semantics>
  <apply>
    <diff/>
    <bvar><ci>x</ci></bvar>
    <apply>
      <ci type="fn">f</ci>
      <ci>x</ci>
    </apply>
  </apply>
  <annotation-xml encoding="MathML-Presentation">
    <mrow>
      <msup>
        <mi>f</mi><mo>&prime;</mo>
      </msup>
      <mo>(</mo><mi>x</mi><mo>)</mo>
    </mrow>
  </annotation-xml>
</semantics>

By default, a particular MathML application might render the content expression in the above markup as . By using presentation markup as an annotation, you can specify that the content expression be rendered as instead.

Alternatively, you can specify the presentation encoding as the first argument and place the content encoding in the second argument. Here is the same example as the one just shown; this time, however, the order of presentation and content markup is reversed:

Top-level parallel markup: example 2

<semantics>
  <mrow>
    <msup>
      <mi>f</mi><mo>&prime;</mo>
    </msup>
    <mo>(</mo><mi>x</mi><mo>)</mo>
  </mrow>
  <annotation-xml encoding="MathML-Content">
    <apply>
      <diff/>
      <bvar><ci>x</ci></bvar>
      <apply>
        <ci type="fn">f</ci>
        <ci>x</ci>
      </apply>
    </apply>
  </annotation-xml>
</semantics>

Notice that the encoding attribute of the annotation-xml element is set to MathML-Content in this case (as opposed to MathML-Presentation in the earlier example).

The type of markup shown in the previous example is useful for applications that are primarily presentation based but that can benefit from additional information provided by the content markup annotation.

   

<< back next >>

 

 

 


 

Copyright © CHARLES RIVER MEDIA, INC., Massachusetts (USA) 2003
Printing of the online version is permitted exclusively for private use. Otherwise this chapter from the book "The MathML Handbook" is subject to the same provisions as those applicable for the hardcover edition: The work including all its components is protected by copyright. All rights reserved, including reproduction, translation, microfilming as well as storage and processing in electronic systems.


CHARLES RIVER MEDIA, INC., 20 Downer Avenue, Suite 3, Hingham, Massachusetts 02043, United States of America