XML technologies / MathML / Combining presentation and content markup / Parallel markup / 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 to top