]> matita.cs.unibo.it Git - helm.git/blob - helm/style/annotatedpres.xsl
Initial revision
[helm.git] / helm / style / annotatedpres.xsl
1 <?xml version="1.0"?>
2
3 <!--***********************************************************************--> 
4 <!-- XSLT version 0.1 of annotated MathML content to MathML presentation:  -->
5 <!-- First draft: March 29 2000, Claudio Sacerdoti Coen, Irene Schena      -->
6 <!--***********************************************************************--> 
7
8 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
9                               xmlns:m="http://www.w3.org/1998/Math/MathML"
10                               xmlns:helm="http://www.cs.unibo.it/helm">
11
12 <xsl:import href="mmlextension.xsl"/>
13
14 <!-- ANNOTATION -->
15
16 <xsl:template match="annotation">
17     <xsl:choose>
18     <xsl:when test=". = /">
19       <m:math><m:mrow helm:xref="{@helm:xref}"><xsl:apply-templates/></m:mrow></m:math>
20     </xsl:when>
21     <xsl:otherwise>
22      <m:mrow helm:xref="{@helm:xref}"><xsl:apply-templates/></m:mrow>
23     </xsl:otherwise>
24     </xsl:choose>
25 </xsl:template>
26
27 <xsl:template match="text()">
28  <xsl:variable name="text" select="normalize-space(.)"/>
29  <xsl:if test="$text != ''">
30   <m:mtext><xsl:value-of select="$text"/></m:mtext>
31  </xsl:if>
32 </xsl:template>
33
34 </xsl:stylesheet>