8.5 Using XSLT with MathML

 < Day Day Up > 



8.5 Using XSLT with MathML

All the examples in Section 8.4 involved the conversion of an XML document into HTML format. In this section, we will see some simple examples of how XSLT can be used to transform MathML documents.

Specifying Notation

An important issue in displaying mathematics is that different notations may be used for the same concept, depending on the context. XSLT transformations provide a good way to convert one notational form into another.

The Tangent Function

For example, the trigonometric function tan(x), is written as tg(x) in some countries. An author in such a country can create an XSLT stylesheet that will detect the occurrence of the <mi>tan<mi> element in a MathML document and convert it into a <mi>tg</mi> element instead. Abrowser will then render the element as tg(x). Hence, any MathML document that contains presentation markup involving the tangent function, such as the one in Example 8.6, can be modified to use the notational form that the author prefers.

Example 8.6: A simple MathML document with presentation markup for the tan function.

start example
    <math>     <mrow>       <mi>tan</mi>       <mrow><mo>(</mo><mi>x</mi><mo>)</mo> </mrow>     </mrow>    </math> 
end example

Example 8.7 shows an XSLT stylesheet that transforms a presentation MathML document by replacing all occurrences of tan with tg.

Example 8.7: An XSLT stylesheet that changes the name of the tangent function.

start example
     <xsl:stylesheet version="1.0"    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">      <xsl:template match="math">        <math><xsl:apply-templates/></math>      </xsl:template>      <xsl:template match="mrow">        <mrow><xsl:apply-templates/></mrow>      </xsl:template>      <xsl:template match="mo">        <mo><xsl:apply-templates/></mo>      </xsl:template>      <xsl:template match="mi">        <xsl:choose>          <xsl:when test="text()='tan'">            <mi>tg</mi>          </xsl:when>          <xsl:otherwise>            <mi><xsl:value-of select="."/></mi>          </xsl:otherwise>        </xsl:choose>      </xsl:template>    </xsl:stylesheet> 
end example

This stylesheet contains templates for the math, mrow, and mo elements that simply implement an identity transformation; that is, they copy the content of any element they match into the output, without making any changes. Each of these templates also adds to the output explicit tags to replace the tags in the input document that are stripped away by the XSLT processor.

The key template in this stylesheet is the one that matches the mi element. This contains an xsl:choose element, which is the XSLT equivalent of a switch or case statement in programming. This element can contain any number of xsl:when elements and a single xsl:otherwise element. Each xsl:when element has a match attribute, which specifies a test condition. If the condition is true, the contents of that xsl:when element are processed; otherwise, the condition in the next xsl:when element is evaluated. If none of the xsl:when elements contains a match attribute that evaluates to true, then the statements in the xsl:otherwise element are processed.

In the stylesheet of Example 8.7, the first xsl:when element checks to see if the text contained in the mi element being processed is "tan". If so, the processor writes out the text "tg" to the output file. Otherwise, the xsl:otherwise element is processed. This element encloses the content of the mi element with a pair of mi tags and copies it to the output document. The net result of this template is therefore to replace any mi element that contains the text tan with an equivalent element that contains the text tg. All other mi elements are copied to the output document unchanged.

The result of applying the stylesheet in Example 8.7 to the MathML document in Example 8.6 is given below (the XML declaration at the start of the output is added automatically by the XSLT processor):

     <?xml version="1.0" encoding="utf-8"?>    <math>      <mrow>        <mi>tg</mi>        <mrow>          <mo>(</mo>          <mi>x</mi>          <mo>)</mo>        </mrow>      </mrow>    </math> 

Binomial Coefficients

Another common mathematical concept for which there are several different notations is the binomial coefficient, . This is also represented as Cnr in France and Crn in Germany. An author who prefers one of these notations can use an XSLT transformation to detect the presence of any alternate notation for this concept, in a MathML document, and convert it into the desired form. Example 8.8 shows a simple MathML document to illustrate this behavior.

Example 8.8: A MathML document that contains the presentation markup for a binomial coefficient.

start example
    <math>     <mrow>       <mo>(</mo>       <mfrac linethickness="0">         <mi>n</mi>         <mi>m</mi>       </mfrac>       <mo<)</mo>     </mrow>    </math> 
end example

The stylesheet shown in Example 8.9 will convert all instances of the markup for in a presentation MathML document into the markup for Cnr.

Example 8.9: An XSLT stylesheet that changes the notation for a binomial coefficient.

start example
     <xsl:stylesheet version="1.0"    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">      <xsl:template match="math">        <math><xsl:apply-templates/></math>      </xsl:template>      <xsl:template match="mrow">        <mrow><xsl:apply-templates select="mfrac"/></mrow>      </xsl:template>        <xsl:template match="mo">          <mo><xsl:apply-templates/></mo>    </xsl:template>      <xsl:template match="mi">        <mi><xsl:apply-templates/></mi>      </xsl:template>      <xsl:template match="mn">        <mn><xsl:apply-templates/></mn>      </xsl:template>      <xsl:template match="mfrac">        <xsl:choose>          <xsl:when test="@linethickness='0'">            <msubsup>              <mi>C</mi>              <xsl:apply-templates select="*[2]"/>              <xsl:apply-templates select="*[1]"/>            </msubsup>          </xsl:when>          <xsl:otherwise>            <mfrac><xsl:apply-templates/></mfrac>          </xsl:otherwise>        </xsl:choose>      </xsl:template>    </xsl:stylesheet>     </math> 
end example

The stylesheet shown in Example 8.9 contains templates for the math, mrow, mn, mi, and mo elements. These templates simply copy the content of the matching element to the output document (after enclosing them in the appropriate tags). The key template in the stylesheet is the one that matches the mfrac element. This template uses the xsl:choose element to check if the currently selected mfrac element has the attribute linethickness set to 0. This condition is implemented by the <xsl:when test="@linethickness='0'> element. Recall that @linethickness='0' is the XPath syntax for specifying an attribute called linethickness, whose value is 0.

If the mfrac element for which the template is being evaluated matches this condition, the statements inside the xsl:when element are evaluated. These statements replace the mfrac element with an msubsup element. The three arguments of the msubsup element are constructed using three separate statements. First, the literal text <mi>C</mi> is copied to the output document to serve as the first argument.

Next, the <xsl:apply-templates select="*[1]/> element is called. This element applies all templates in the current context that match the value specified by the select attribute. This attribute has the value *[1], which is the XPath syntax for the first child element of the current node. Hence, the net effect of this statement is to copy the first argument of the mfrac element into the output document to serve as the third argument of the msubsup element.

Finally, the <xsl:apply-templates select="*[2]/> element is called. This element takes the second argument of the mfrac element in the input document and copies it as the second argument of the msubsup element in the output document.

Applying the stylesheet in Example 8.9 to the MathML document in Example 8.8 yields the following output:

    <?xml version="1.0" encoding="utf-8"?><math>     <mrow><msubsup><mi>C</mi><mi>m</mi><mi>n</mi>       </msubsup></mrow> 

Hence, the net effect of the stylesheet is to convert the markup for markup for Cnr. You can easily modify the same stylesheet to produce the markup for the alternative notational form, Crn, if desired. To do so, you would just reverse the order of two statements in the template for the mfrac element, as shown below:

    <xsl:apply-templates select="*[1]"/>    <xsl:apply-templates select="*[2]"/> 

This causes the first and second arguments of the mfrac element in the input document to become the second and third arguments of the msubsup element in the output, respectively.

Note that if the input document does not contain an <mfrac linethickness="0"> attribute, then the condition in the xsl:when element of the stylesheet evaluates to false, and the statements in the xsl:otherwise element are applied instead. This has the effect of simply copying the mfrac element unchanged into the output, which is what you want to happen.

Translating between Content and Presentation Markup

In the XSLT transformations discussed so far, both the input and the output were in the form of presentation MathML. However, XSLT is also an effective tool for transforming content MathML into presentation MathML, or vice versa.

Converting presentation MathML to content MathML is useful in situations where the mathematical meaning of the markup is important. For example, a student might want to copy a mathematical formula displayed in a Web page (using presentation MathML) and then paste the markup into a computer algebra system for evaluation. For many types of formulas, the mathematical meaning can be inferred from the notation and so a stylesheet can apply simple heuristic rules for transforming presentation markup into content markup.

For example, a superscript, as in x2, can be interpreted as a power. However, this is not always accurate. There could be some cases, for example, where an author uses x2 to denote the second component of a vector x. In general, any notation described using presentation MathML can have more than one meaning or sometimes no meaning at all. Hence, it is impossible to write a single stylesheet that is general enough to convert any arbitrary presentation MathML into content MathML, even though such a conversion is possible in specific cases.

A more realistic goal is to do the reverse transformation; that is, convert content markup into presentation markup. Since content markup specifies mathematical meaning unambiguously, this type of conversion is always possible. In principle, one can create a single stylesheet that is general enough to take almost any type of valid content markup expression and convert it into the corresponding presentation markup. Such a stylesheet can be very useful since it allows you to specify the notation for a formula independently of its mathematical meaning. For example, an author can create a technical paper in which all the formulas are specified using content MathML. A publisher can then use an XSLT stylesheet to convert the content MathML in the document into presentation MathML while applying specific notational rules that enforce the style of a particular journal.

The conversion of content markup into presentation markup is also of great importance when you are displaying MathML in Web browsers. Most browsers that support native display of MathML, such as Amaya, Mozilla 1.0, and Netscape 7.0, can recognize only MathML presentation tags. They cannot render content MathML. However, Mozilla 1.0 and Netscape 7.0do have built-in support for XSLT transformations. Hence, one possible strategy for rendering content MathML in such browsers is to use an XSLT stylesheet that will convert any content MathML expression into presentation MathML. This can then be displayed using the browser's native rendering abilities.

David Carlisle, as part of his work on the Universal MathML stylesheet, has successfully implemented this approach. As we saw in Section 7.2, this is a large and complex XSLT stylesheet that allows both content and presentation MathML to be displayed on a wide variety of browsers and using a variety of plug-ins. One feature of this stylesheet is that it includes templates for all the different types of content elements. When applied to any document that contains content MathML, the stylesheet automatically transforms each instance of content MathML in the document into an equivalent presentation MathML expression.

In this section, we focus on giving some simple examples of XSLT transformations for converting content MathML to presentation MathML. Of course, you do not need to write such a stylesheet from scratch; for most purposes, you can use the stylesheet already created by David Carlisle. The purpose of this section is to illustrate some of the general techniques and issues involved in doing such conversions. You can then use these techniques to customize the existing stylesheet, for example, to implement a different set of notational preferences.

Factorials

As the first example, let's write a stylesheet that will transform a content MathML document involving the factorial operator into presentation MathML. Example 8.10 shows a simple MathML document that we can use to illustrate this behavior.

Example 8.10: A content MathML document that uses the factorial element.

start example
    <math>     <apply>       <factorial/>       <ci>n</ci>     </apply>    </math> 
end example

The factorial operator is typically indicated by an exclamation mark after its operand; that is, the factorial of n is shown as n!. Example 8.11 shows a simple stylesheet that generates presentation markup using this notation.

Example 8.11: An XSLT stylesheet for transforming content MathML expressions involving the factorial operator.

start example
     <xsl:stylesheet version="1.0"    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">      <xsl:template match="math">        <math><xsl:apply-templates/></math>      </xsl:template>      <xsl:template match="ci">        <mi><xsl:apply-templates/></mi>      </xsl:template>      <xsl:template match="apply[factorial]">        <mrow><xsl:apply-templates select="*[2]"/>        <mo>!</mo></mrow>      </xsl:template>    </xsl:stylesheet> 
end example

The key template in the stylesheet is the one for the apply element. The select attribute of this template has the value apply[factorial], which is the XPath expression for an apply element having a factorial element as one of its children. When this template is matched, it first writes an opening mrow tag to the output. It then triggers all templates that match the second child of the apply element, which happens to be a ci element. This triggers the template for the ci element, which simply copies the content of the matched ci element into the output and replaces the ci tags with mi tags. The template for the apply element then resumes and copies the literal text <mo>!</mo> to the output, followed by a closing mrow tag.

Applying the stylesheet in Example 8.11 to the document in Example 8.10 yields the following output:

    <?xml version="1.0" encoding="utf-8"?><math>     <mrow><mi>n</mi><mo>!</mo></mrow>    </math> 

The stylesheet in Example 8.11 is a relatively simple one and is not general enough to accommodate all the different contexts in which a factorial element might occur in a content MathML expression. It is easy to construct cases where the stylesheet breaks down. For example, suppose you used the content MathML expression for the factorial of 2n as the input expression instead of n, as shown in Example 8.12.

Example 8.12: A MathML document that contains the content markup for (2n)!

start example
    <math>     <apply>       <factorial/>       <apply><mn>2</mn><ci>n</ci></apply>     </apply>    </math> 
end example

Applying the same stylesheet to this expression yields the following output:

    <?xml version="1.0" encoding="utf-8"?><math>     <mrow>2       <mi>n</mi><mo>!</mo></mrow>    </math> 

This output is not valid presentation markup since the 2 is not enclosed in an mn element, as required by MathML. The reason for this is that the stylesheet in Example 8.11 does not contain a template for the cn element. Hence, when a cn element is encountered, the default template for it is used, which has the effect of simply copying the element's content without wrapping it in any tags. For cn elements to be processed properly, we can add the following template to the stylesheet:

    <xsl:template match="cn">     <mn><xsl:apply-templates/></mn>    </xsl:template> 

With the addition of this template to the stylesheet in Example 8.11, processing the document in Example 8.12 yields the following output:

    <?xml version="1.0" encoding="utf-8"?><math>     <mrow><mn>2</mn>       <mi>n</mi><mo>!</mo></mrow>    </math> 

This is better than before since now at least the 2 is properly enclosed in the tags for the mn element. However, there is still a problem with the output expression. If it is rendered in a browser, it will appear as 2n!, which is ambiguous, since it could represent either the factorial of 2n or two times the factorial of n. Of course, presentation markup specifically provides the entity reference &InvisibleTimes; to distinguish such cases. We could, of course, modify our stylesheet to insert this reference in cases where multiplication is intended. But it would be better still to use parentheses to explicitly indicate all complex operands to which the factorial operator is applied, as in (2n)!. You can achieve this by modifying the template for the apply element in Example 8.11 to the form shown below:

    <xsl:template match="apply[factorial]">     <mrow>     <xsl:choose>       <xsl:when test="(*2=(ci or cn))">         <xsl:apply-templates select="*[2]"/>          <mo>!</mo></mrow>       </xsl:when>       <xsl:otherwise>         <mrow><mo>(</mo>         <xsl:apply-templates select="*[2]"/>         <mo>)</mo></mrow><mo>!</mo></mrow>       </xsl:otherwise>     </xsl:choose>     </mrow>    </xsl:template> 

The difference between this and the template shown in Example 8.11 is that now we have included an xsl:when element for conditional processing. When the child element immediately following the factorial element is either a ci or cn element, the same processing is done as in Example 8.11. Otherwise, parentheses are placed around the expression. The revised template therefore takes into account information about the context in which the factorial element occurs. Example 8.13 shows the stylesheet of Example 8.11 modified to include the more complex template shown above as well as a template for the cn element.

Example 8.13: An XSLT stylesheet that causes parentheses to be placed around complex operands of the factorial operator.

start example
    <xsl:stylesheet version="1.0"       xmlns:xsl="http://www.w3.org/1999/XSL/Transform">         <xsl:template match="math">           <math><xsl:apply-templates/></math>         </xsl:template>         <xsl:template match="ci">           <mi><xsl:apply-templates/></mi>         </xsl:template>         <xsl:template match="cn">           <mn><xsl:apply-templates/></mn>         </xsl:template>         <xsl:template match="apply[factorial]">          <mrow>         <xsl:choose>           <xsl:when test="(*2=(ci or cn))">              <xsl:apply-templates select="*[2]"/>               <mo>!</mo></mrow>          </xsl:when>          <xsl:otherwise>               <mrow><mo>(</mo>               <xsl:apply-templates select="*[2]"/>               <mo>)</mo></mrow><mo>!</mo></mrow>          </xsl:otherwise>         </xsl:choose>         </mrow>      </xsl:template>    </xsl:stylesheet> 
end example

Applying the stylesheet of Example 8.13 to the document in Example 8.10 yields the following output, which renders correctly as (2n)!:

    <?xml version="1.0" encoding="utf-8"?><math> <mrow><mo>(</mo><mn>2</mn><mi>n</mi><mo>)</mo></mrow>     <mo>!</mo></mrow>    </math> 

Integrals

The last example demonstrated the importance of writing templates that take into account the context in which specific elements might occur in the input document. It is not enough to write a stylesheet that works as intended for a specific document. For the stylesheet to be generally useful, the template for any element must be sufficiently robust to work properly in all the possible contexts that the element could occur. Also, since templates can be called recursively, it is important to ensure that the templates for different elements do not interact in unintended ways. Clearly, writing a stylesheet that is general enough to work for all documents that could be written in a particular XML format, such as MathML, is a challenging task and requires a great deal of testing and fine-tuning.

The importance of making templates that are as general as possible is illustrated in the next example. Suppose we want to create a stylesheet that will convert the content markup for an integral into the corresponding presentation markup. Example 8.14 shows the content markup for a simple integral: sin(x)dx. Notice that the limits of the integral are specified using the qualifier elements lowlimit and uplimit.

Example 8.14: A MathML document showing the content markup for an integral.

start example
    <math>     <apply>       <int/>       <bvar><ci>x</ci></bvar>       <lowlimit><ci>a</ci></lowlimit>       <uplimit><ci>b</ci></uplimit>       <apply>       <ci>sin</ci>       <ci>x</ci>       </apply>     </apply>    </math> 
end example

Example 8.15 shows an XSLT stylesheet for transforming expressions like Example 8.14 into presentation markup.

Example 8.15: An XSLT stylesheet for transforming the content markup for an integral into presentation markup.

start example
     <xsl:stylesheet version="1.0"    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">      <xsl:template match="math">        <math><xsl:apply-templates/></math>      </xsl:template>      <xsl:template match="ci">        <mi><xsl:apply-templates/></mi>      </xsl:template>      <xsl:template match="apply[sin]">        <mrow><mi>sin</mi><mo>(</mo>        <xsl:apply-templates/><mo>)</mo></mrow>      </xsl:template>      <xsl:template match="apply[int]">        <mrow>          <msubsup>            <mo>&#8747;</mo>            <mrow>              <xsl:apply-templates select="lowlimit"/>            </mrow>            <mrow>              <xsl:apply-templates select="uplimit"/>            </mrow>          </msubsup>          <xsl:apply-templates select="last()"/>          <mo>d</mo>          <xsl:apply-templates select="bvar"/>        </mrow>      </xsl:template>    </xsl:stylesheet> 
end example

The key template in this stylesheet is the one whose select attribute is set to apply[int]. This template is matched by any apply element that contains an int element. The three important statements in this template are:

     <xsl:apply-templates select="lowlimit"/>    <xsl:apply-templates select="uplimit"/>     <xsl:apply-templates select="last()"/> 

These statements apply all templates that match a lowlimit, uplimit, and the last child element in the apply element, respectively. last() is an XPath expression that refers to the last child element in the current context.

Applying the stylesheet of Example 8.15 to the document in Example 8.14 results in the following output:

    <?xml version="1.0" encoding="utf-8"?><math>     <mrow><msubsup><mo>&8747;</mo><mi>a</mi><mi>b</mi>     </msubsup><mrow><mi><sin></mi><mi>x</mi><mo>d</mo>     <mi>x</mi></mrow></mrow>    </math> 

If this presentation markup is viewed in a MathML-enabled browser, it renders as sin(x)dx, indicating that the transformation was indeed successful.

However, the template used for the int element in Example 8.15 is not very general. Recall that in content markup, the limits of a definite integral can also be represented using other content elements, such as interval and condition. For example, the integral of Example 8.15 can also be represented using the content markup shown in Example 8.16.

Example 8.16: A content MathML document that represents an integral using the interval element.

start example
    <math>     <apply>        <int/>        <bvar><ci>x</ci></bvar>        <interval><ci>a</ci><ci>b</ci></interval>        <apply>        <ci>sin</ci>        <ci>x</ci>        </apply>     </apply>    </math> 
end example

You can extend the stylesheet in Example 8.15 to take into account this alternative method of representing the limits of an integral. The only template that needs to be changed is the one that matches the apply[int] element. You can generalize the xsl:apply-templates elements that match the lowlimit and uplimit elements by modifying the value of their select attribute. The modified elements look as follows:

    <xsl:apply-templates select="lowlimit|interval/*[1]"/>    <xsl:apply-templates select="uplimit|interval/*[2]"/> 

Here, lowlimit|interval/*[1] is an XPath expression that matches either a lowlimit element or the first child of the interval element. Similarly, uplimit|interval/*[2] matches either the uplimit element or the second child of the interval element. The modified stylesheet with these generalized elements is shown in Example 8.17.

Example 8.17: A modified XSLT stylesheet for converting integrals from content markup to presentation markup.

start example
    <dis1><xsl:stylesheet version="1.0"       xmlns:xsl="http://www.w3.org/1999/XSL/Transform">         <xsl:template match="math">           <math><xsl:apply-templates/></math>         </xsl:template>         <xsl:template match="ci">           <mi><xsl:apply-templates/></mi>         </xsl:template>         <xsl:template match="apply[sin]">           <mrow><mi>sin</mi><mo>(</mo>           <xsl:apply-templates/><mo>)</mo></mrow>         </xsl:template>         <xsl:template match="apply[int]">           <mrow>             <msubsup>               <mo>&#8747;</mo>               <mrow>                 <xsl:apply-templates                 select="lowlimit|interval/*[1]"/>               </mrow>               <mrow>                 <xsl:apply-templates                 select="uplimit|interval/*[2]"/>               </mrow>             </msubsup>             <xsl:apply-templates select="last()"/>             <mo>d</mo>             <xsl:apply-templates select="bvar"/>           </mrow>         </xsl:template>    </xsl:stylesheet> 
end example

Applying the stylesheet of Example 8.17 to the document in Example 8.16 results in the following output:

    <?xml version="1.0" encoding="utf-8"?><math>     <mrow><msubsup><mo>&8747;</mo><mi>a</mi><mi>b</mi>     </msubsup><mrow><mi><sin></mi><mi>x</mi><mo>d</mo>     <mi>x</mi></mrow></mrow>    </math> 

It is easy to generalize the stylesheet further so it can handle integrals in which the limits are represented using the condition element, as well as the interval or lowlimit and uplimit elements. This would require adding templates for all elements that can occur as child elements of the condition element.

Creating Macros

Another important use of XSLT in working with MathML is for creating macros to abbreviate complex notation. For example, suppose you are authoring a document in which a complicated expression is repeated frequently. Instead of writing out the full expression each time, you can use an XSLT stylesheet to define a new element to represent the whole expression. This allows you to write out the entire document in a much more compact form. Once the document is finished, you can replace each occurrence of the macro with the corresponding MathML expression by using the XSLT stylesheet that contains the definition for the macro.

This technique is particularly useful when you are defining new elements to represent concepts not covered in the existing MathML specification. For example, content MathML does not include any element that correspond to the concept of the trace of matrix. Hence, suppose we wanted to encode a statement like the one below:

You could define a new element called x:trace to represent this concept. You can specify the notation and meaning of this element in terms of standard MathML elements by using a semantics element. In other words, you can define x:trace to be equivalent to the following expression:

    <semantics>     <mi>Tr</mi>     <annotation-xml encoding="OpenMath">       <function name="Trace" cd="linalg3"       xmlns="http://www.openmath.org/OpenMath"/>     <annotation-xml>    </semantics> 

If you then wanted to encode a statement like Tr(A + B) = Tr(A) + Tr(B), you could use the following markup:

    <apply>     <eq/>       <apply>         <x:trace/>         <apply><plus/><ci>A</ci><ci>B</ci></apply>       </apply>       <apply>         <plus/>         <apply><x:trace/><ci>A</ci></apply>         <apply><x:trace/><ci>B</ci></apply>       </apply>    </apply> 

This is much more compact than having to use the full semantics element in place of each occurrence of x:trace. Of course, the x:trace element exists only in a private namespace and would not be recognized by other MathML processing applications. Hence, before processing the document further, you can replace all macros with their full form by applying an XSLT stylesheet that contains a template of the form shown below:

    <xsl:template match="x:trace">     <semantics>     <mi>Tr</mi>     <annotation-xml encoding="OpenMath">       <function name="Trace" cd="linalg3"       xmlns="http://www.openmath.org/OpenMath"/>     <annotation-xml>    </semantics>       </xsl:template> 

Of course, in practice, most MathML markup will not be authored by hand but rather generated by special authoring software. Hence, the strategy described here for defining, inserting, and replacing macros is best implemented by a particular software application. The point here is that XSLT transformations provide a convenient mechanism for carrying out this kind of replacement procedure, even if the actual details are concealed under a more high-level interface.



 < Day Day Up > 



The MathML Handbook
The MathML Handbook (Charles River Media Internet & Web Design)
ISBN: 1584502495
EAN: 2147483647
Year: 2003
Pages: 127
Authors: Pavi Sandhu

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net