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 |- #############################################################################
10 | PURPOSE: MathML presentation and content markup.
11 | Note: these elements are not part of the DocBook DTD. I have extended
12 | the docbook DTD in order to support this tags, so that's why I have these
15 | MathML namespace used -> mml
16 + ############################################################################## -->
18 <xsl:stylesheet version='1.0'
19 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
20 xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns="http://www.w3.org/1998/Math/MathML">
22 <xsl:strip-space elements="mml:math mml:mrow"/>
25 <xsl:template match="mml:math">
26 <xsl:text>
\r\begin{displaymath}
\r</xsl:text>
27 <xsl:apply-templates/>
28 <xsl:text>
\r\end{displaymath}
\r</xsl:text>
31 <xsl:template match="mml:math[@mode='inline']">
32 <xsl:text> \begin{math} </xsl:text>
33 <xsl:apply-templates/>
34 <xsl:text> \end{math} </xsl:text>
37 <xsl:template match="mml:math[@mode='display']">
38 <xsl:text>
\r\begin{displaymath}
\r</xsl:text>
39 <xsl:apply-templates/>
40 <xsl:text>
\r\end{displaymath}
\r</xsl:text>
44 <xsl:template match="p">
45 <xsl:text>\section{</xsl:text> <xsl:value-of select="normalize-space(.)"/> <xsl:text>}
\r</xsl:text>