]> matita.cs.unibo.it Git - helm.git/blob - helm/style/style_prima_del_linguaggio_naturale/annotatedcont.xsl.csc
3508d6be425966a4f84eb1b15c8a8795935f7682
[helm.git] / helm / style / style_prima_del_linguaggio_naturale / annotatedcont.xsl.csc
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
11 <xsl:import href="objcontent.xsl"/>
12
13 <xsl:template match="Definition|Axiom|CurrentProof|InductiveDefinition|Variable">
14     <xsl:choose>
15     <xsl:when test="'annotation' != name(*[1])">
16      <xsl:apply-templates select="." mode="noannot"/>
17     </xsl:when>
18     <xsl:otherwise>
19      <annotation>
20       <xsl:apply-templates select="annotation"/>
21      </annotation>
22     </xsl:otherwise>
23     </xsl:choose>
24 </xsl:template>
25
26 <xsl:template match="LAMBDA|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX">
27   <xsl:param name="backpointer" select="''"/>
28     <xsl:choose>
29     <xsl:when test="'Annotation' != name(*[1])">
30      <m:math>
31       <xsl:apply-templates select="." mode="noannot">
32        <xsl:with-param name="backpointer" select="$backpointer"/>
33       </xsl:apply-templates>
34      </m:math>
35     </xsl:when>
36     <xsl:otherwise>
37      <annotation>
38       <xsl:apply-templates select="Annotation"/>
39      </annotation>
40     </xsl:otherwise>
41     </xsl:choose>
42 </xsl:template>
43
44 <!-- DA MODIFICARE PER GESTIRE I RIFERIMENTI A SOTTOANNOTAZIONI O NODI MATH -->
45
46 <xsl:template match="nephew">
47  <xsl:variable name="select" select="@no"/>
48  <xsl:apply-templates select="../../*[2]/*[number($select)]"/>
49 </xsl:template>
50
51 <xsl:template match="brother">
52  <xsl:variable name="select" select="@no"/>
53  <xsl:apply-templates select="../../*[number($select) + 1]"/>
54 </xsl:template>
55
56 <xsl:template match="name">
57  <xsl:value-of select="../../*[2]/@name"/>
58 </xsl:template>
59
60 <xsl:template match="nephew-name">
61  <xsl:variable name="select" select="@no"/>
62  <xsl:value-of select="../../*[2]/*[number($select)]/@name"/>
63 </xsl:template>
64
65 </xsl:stylesheet>
66