XML technologies / MathML / Content markup / Constructor elements / The apply element

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

We saw several examples of the apply element under Presentation and content. This is by far the most common content element, since it represents one of the most basic mathematical concepts, that of applying an operator or function to its arguments.

The first child element of the apply element is the operator or function to be applied. The subsequent elements are the arguments of the function or the operands of the operator. The number of subsequent child elements allowed depends on the operator or function specified as the first child element. For example, the plus element can be followed by zero or more child elements while the minus element must have either one or two child elements after it.

The operator or function specified as the first child element of the apply element can be represented in three ways:

Here is a simple example of using the apply element:

The apply element: equation 1

<apply>
  <sin/>
  <ci>x</ci>
</apply>

You can easily distinguish two different expressions that look similar but have different mathematical meanings by the number and position of apply elements used in the content markup. For example, the following markup represents the result of applying the sum of two functions f and g to the argument x:

The apply element: equation 2

<apply>
  <apply>
    <plus/>
    <ci>f</ci>
    <ci>g</ci>
  </apply>
  <ci>x</ci>
</apply>

The following markup represents the multiplication of the sum of two variables f and g with x:

The apply element: equation 3

<apply>
  <times/>
  <apply>
    <plus/>
    <ci>f</ci>
    <ci>g</ci>
  </apply>
  <ci>x</ci>
</apply>

   

 

 

 

 

back to top