XSLT stylesheets

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

As discussed under XSLT primer, XSLT transformations provide a flexible and powerful method for converting arbitrary XML data into other formats. In particular, you can use XSLT for transforming MathML equations into LaTeX. Vasil Yaroshevich has implemented this approach in the form of an XSLT MathML Library. This is a collection of six XSLT stylesheets that together specify how to translate any arbitrary presentation MathML expression into LaTeX. Currently, the stylesheets handle conversion from presentation MathML only, but support for content MathML is likely to be added in the future.

The XSLT MathML library consists of the following six stylesheets:

  • mmltex.xsl
  • tokens.xsl
  • glayout.xsl
  • scripts.xsl
  • tables.xsl
  • entities.xsl

The templates for transforming token elements, layout schemata, scripts, tables, and entities are placed in separate stylesheets for the sake of modularity. However, for transforming a given MathML document, you only need to refer to a top-level stylesheet called mmltex.xsl. This contains commands for importing the template definitions from all the other stylesheets.

To use the XSLT MathML Library for translating MathML into LaTeX, you have two options. You can do interactive trials on the Web page set up by the author of the library (see the following figure). You can enter any MathML expression in the text area provided and then click a button to view the corresponding LaTeX markup in the same page. This is useful for translating individual equations and experimenting with how the stylesheets work.

Converting presentation MathML into LaTeX using XSLT transformations

Figure: Converting presentation MathML into LaTeX using XSLT transformations. © 2002 Vasil Yaroshevich. All rights reserved.

   

<< 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