Fine-grained parallel markup

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

In top-level parallel markup, the content and presentation markup for the entire expression are each contained in a different branch of a single semantics element. Thus, the correspondence between the presentation and content encodings is for the entire expression as a whole. However, in some contexts, you need to specify the correspondence between presentation and content encodings of subexpressions of the main expression as well. One way to accomplish this is to use nested semantics elements, thereby creating what is called fine-grained parallel markup.

This type of markup can be useful, for example, in an equation editor that allows a user to build up complicated expressions by nesting and combining smaller, simpler subexpressions. Suppose the application internally stores a representation of each expression in MathML form. Since a user might select a particular fragment of a large expression for copying and pasting, it is desirable for both the content and presentation markup of the selected fragment to be included in the content copied to the clipboard.

Consider the following example of top-level parallel markup:

Fine-grained parallel markup: example 1

<semantics>
  <mrow>
    <msup><mi>x</mi><mn>2</mn></msup>
    <mo>+</mo>
    <mrow>
      <mi>sin</mi>
      <mo>&ApplyFunction;</mo>
      <mo>(</mo><mi>x</mi><mo>)</mo>
    </mrow>
  </mrow>
  <annotation-xml encoding='MathML-Content'>
    <apply>
      <plus/>
      <apply>
        <power/>
        <ci>x</ci><cn>2</cn>
      </apply>
      <apply>
        <sin/>
        <ci>x</ci>
      </apply>
    </apply>
  </annotation-xml>
</semantics>

Here is the same expression represented using fine-grained parallel markup, involving two nested semantics elements:

<semantics>
  <mrow>
    <semantics>
      <msup><mi>x</mi><mn>2</mn></msup>
      <annotation-xml encoding="MathML-Content">
        <apply><power/><ci>x</ci><cn>2</cn></apply>
      </annotation-xml>
    </semantics>
    <mo>+</mo>
    <semantics>
      <mrow>
        <mi>sin</mi><mo>&ApplyFunction;</mo>
        <mo>(</mo><mi>x</mi><mo>)</mo>
      </mrow>
      <annotation-xml encoding="MathML-Content">
        <apply><sin/><ci>x</ci></apply>
      </annotation-xml>
    </semantics>s
  </mrow>
  <annotation-xml encoding="MathML-Content">
    <apply>
      <plus/>
      <apply><power/><ci>x</ci><cn>2</cn></apply>
      <apply><sin/><ci>x</ci></apply>
    </apply>
  </annotation-xml>
</semantics>

This markup provides separate content and presentation encodings of the two terms x2 and sin(x), as well as for the top-level expression, x2 + sin(x).

   

<< back next >>

 

 

 

Tipp der data2type-Redaktion:
Zum Thema MathML bieten wir auch folgende Schulungen zur Vertiefung und professionellen Fortbildung an:

 

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