2 <!DOCTYPE xsl:stylesheet
4 <!ENTITY % mmlalias PUBLIC "MathML alias" "ent/mmlalias.ent"> %mmlalias;
5 <!ENTITY % mmlextra PUBLIC "MathML extra" "ent/mmlextra.ent"> %mmlextra;
7 <!--#############################################################################
8 | $Id: mathml.mod.xsl,v 1.1 2003/04/30 21:39:49 ab Exp $
9 |- #############################################################################
12 | PURPOSE: MathML presentation and content markup.
13 | Note: these elements are not part of the DocBook DTD. I have extended
14 | the docbook DTD in order to support this tags, so that's why I have these
17 | MathML namespace used -> mml
18 + ############################################################################## -->
20 <xsl:stylesheet version='1.0'
21 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
22 xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns="http://www.w3.org/1998/Math/MathML">
24 <xsl:strip-space elements="mml:math mml:mrow"/>
27 <xsl:template match="mml:math">
28 <xsl:text>
\r\begin{displaymath}
\r</xsl:text>
29 <xsl:apply-templates/>
30 <xsl:text>
\r\end{displaymath}
\r</xsl:text>
33 <xsl:template match="mml:math[@mode='inline']">
34 <xsl:text> \begin{math} </xsl:text>
35 <xsl:apply-templates/>
36 <xsl:text> \end{math} </xsl:text>
39 <xsl:template match="mml:math[@mode='display']">
40 <xsl:text>
\r\begin{displaymath}
\r</xsl:text>
41 <xsl:apply-templates/>
42 <xsl:text>
\r\end{displaymath}
\r</xsl:text>
46 <xsl:template match="p">
47 <xsl:text>\section{</xsl:text> <xsl:value-of select="normalize-space(.)"/> <xsl:text>}
\r</xsl:text>