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 <!--***********************************************************************-->
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">
12 <xsl:import href="objcontent.xsl"/>
14 <xsl:key name="id" use="@id" match="LAMBDA|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX|Definition|Axiom|CurrentProof|InductiveDefinition|Variable"/>
16 <xsl:key name="annid" use="@of" match="Annotation"/>
18 <xsl:template match="Definition|Axiom|CurrentProof|InductiveDefinition|Variable">
20 <xsl:when test="key('annid',@id)">
21 <annotation helm:xref="{@id}">
22 <xsl:apply-templates select="key('annid',@id)"/>
26 <xsl:apply-templates select="." mode="noannot"/>
31 <xsl:template match="LAMBDA|PROD|CAST|REL|SORT|APPLY|VAR|META|CONST|MUTIND|MUTCONSTRUCT|MUTCASE|FIX|COFIX">
33 <xsl:when test="key('annid',@id)">
34 <annotation helm:xref="{@id}">
35 <xsl:apply-templates select="key('annid',@id)"/>
40 <xsl:apply-templates select="." mode="noannot"/>
46 <xsl:template match="node">
47 <xsl:variable name="id" select="@id"/>
48 <xsl:apply-templates select="key('id',$id)"/>
51 <xsl:template match="attribute">
52 <xsl:variable name="id" select="@id"/>
53 <xsl:variable name="name" select="@name"/>
54 <xsl:variable name="child" select="@child"/>
55 <xsl:variable name="grandchild" select="@grandchild"/>
57 <xsl:when test="$child">
59 <xsl:when test="$grandchild">
60 <xsl:value-of select="key('id',$id)/*[position() = $child]/*[position() = $grandchild]/attribute::*[name() = $name]"/>
63 <xsl:value-of select="key('id',$id)/*[position() = $child]/attribute::*[name() = $name]"/>
68 <xsl:value-of select="key('id',$id)/attribute::*[name() = $name]"/>