3 <!-- Copyright (C) 2000, HELM Team -->
5 <!-- This file is part of HELM, an Hypertextual, Electronic -->
6 <!-- Library of Mathematics, developed at the Computer Science -->
7 <!-- Department, University of Bologna, Italy. -->
9 <!-- HELM is free software; you can redistribute it and/or -->
10 <!-- modify it under the terms of the GNU General Public License -->
11 <!-- as published by the Free Software Foundation; either version 2 -->
12 <!-- of the License, or (at your option) any later version. -->
14 <!-- HELM is distributed in the hope that it will be useful, -->
15 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
16 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
17 <!-- GNU General Public License for more details. -->
19 <!-- You should have received a copy of the GNU General Public License -->
20 <!-- along with HELM; if not, write to the Free Software -->
21 <!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, -->
22 <!-- MA 02111-1307, USA. -->
24 <!-- For details, see the HELM World-Wide-Web page, -->
25 <!-- http://cs.unibo.it/helm/. -->
27 <!--******************************************************************-->
28 <!-- XSLT version 0.1 of CIC objects to objects and MathML content: -->
29 <!-- First draft: March 21 2000, Irene Schena -->
30 <!--******************************************************************-->
32 <!--******************************************************************-->
33 <!-- MANCA: gestione annotation e linking -->
34 <!--******************************************************************-->
36 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
37 xmlns:m="http://www.w3.org/1998/Math/MathML"
38 xmlns:helm="http://www.cs.unibo.it/helm">
40 <xsl:import href="content.xsl"/>
44 <xsl:template match="cicxml">
45 <xsl:variable name="url"><xsl:value-of select="@baseurl"/></xsl:variable>
46 <xsl:variable name="stylesheet"><xsl:value-of select="@stylesheet"/></xsl:variable>
48 <xsl:processing-instruction name="cocoon-format">type="text/xml"</xsl:processing-instruction>
49 <xsl:processing-instruction name="xml-stylesheet">href="<xsl:value-of select='concat($url,$stylesheet)'/>" type="text/xsl"</xsl:processing-instruction>
50 <xsl:processing-instruction name="cocoon-process">type="xslt"</xsl:processing-instruction>
52 <xsl:apply-templates select="*[1]"/>
56 <!-- FUNZIONI AUSILIARIE -->
58 <xsl:template name="name_of_uri_bis">
59 <xsl:param name="uri" select=""""/>
60 <xsl:variable name="suffix" select="substring-after($uri, "/")"/>
62 <xsl:when test="$suffix = """>
63 <xsl:value-of select="substring-before($uri,".var")"/>
66 <xsl:call-template name="name_of_uri_bis">
67 <xsl:with-param name="uri" select="$suffix"/>
73 <xsl:template name="var_name">
74 <xsl:param name="uri"/>
75 <xsl:param name="string" select=""""/>
76 <xsl:variable name="prefix" select="substring-before($uri, " ")"/>
77 <xsl:variable name="suffix" select="substring-after($uri, " ")"/>
78 <xsl:variable name="prefix">
79 <xsl:call-template name="name_of_uri_bis">
80 <xsl:with-param name="uri" select="$prefix"/>
83 <!--xsl:if test="string($prefix) != " " "-->
84 <xsl:variable name="string" select="concat($string,', ', $prefix)"/>
87 <xsl:when test="$suffix = """>
88 <xsl:value-of select="substring-after(concat($string, ' '),',')"/>
91 <xsl:call-template name="var_name">
92 <xsl:with-param name="uri" select="$suffix"/>
93 <xsl:with-param name="string" select="$string"/>
102 <xsl:template match="Sequent"> <!-- For Sequents there are no annotations -->
103 <Sequent helm:xref="{@id}" no="{@no}">
104 <xsl:for-each select="Decl|Def|Hidden">
106 <xsl:attribute name="name">
107 <xsl:value-of select="@name"/>
109 <xsl:attribute name="helm:xref">
110 <xsl:value-of select="@id"/>
112 <xsl:apply-templates select="*[1]"/>
116 <xsl:apply-templates select="Goal/*[1]"/>
121 <xsl:template match="ConstantType" mode="noannot">
122 <Definition name="{@name}" helm:xref="{@id}">
123 <xsl:if test="string(@params) != """>
125 <xsl:call-template name="var_name">
126 <xsl:with-param name="uri" select="concat(@params, ' ')"/>
131 <xsl:when test="$showproof=0">
138 <xsl:apply-templates select="body"/>
144 <xsl:apply-templates select="./*[1]"/>
149 <xsl:template match="ConstantBody" mode= "noannot">
150 <Definition name="{@for}" helm:xref="{@id}">
151 <xsl:if test="string(@params) != """>
153 <xsl:call-template name="var_name">
154 <xsl:with-param name="uri" select="concat(@params, ' ')"/>
159 <xsl:apply-templates select="./*[1]"/>
162 <xsl:apply-templates select="document($ConstantTypeUrl)/*[1]/*[1]"/>
168 <xsl:template match="CurrentProof" mode="noannot">
169 <CurrentProof name="{@of}" helm:xref="{@id}">
170 <xsl:for-each select="Conjecture">
171 <Conjecture no="{@no}" helm:xref="{@id}">
172 <xsl:for-each select="*">
174 <xsl:copy-of select="@name"/>
175 <xsl:attribute name="helm:xref">
176 <xsl:value-of select="@id"/>
178 <xsl:apply-templates select="*"/>
184 <xsl:apply-templates select="body/*[1]"/>
187 <xsl:apply-templates select="document($ConstantTypeUrl)/*[1]/*[1]"/>
192 <xsl:template match="InductiveDefinition" mode="noannot">
193 <InductiveDefinition helm:xref="{@id}">
194 <xsl:if test="string(@params) != """>
196 <xsl:value-of select="@params"/>
199 <xsl:if test="string(@noParams) != 0">
200 <xsl:apply-templates select="InductiveType/arity/*[1]" mode="abstparams">
201 <xsl:with-param name="noparams" select="@noParams"/>
202 </xsl:apply-templates>
204 <xsl:for-each select="InductiveType">
205 <InductiveType name="{./@name}" inductive="{./@inductive}">
207 <xsl:apply-templates select="./arity/*[1]" mode="abstparams">
208 <xsl:with-param name="noparams" select="../@noParams"/>
209 <xsl:with-param name="target" select="1"/>
210 </xsl:apply-templates>
212 <xsl:for-each select="./Constructor">
213 <Constructor name="{./@name}">
214 <xsl:apply-templates select="./*[1]" mode="abstparams">
215 <xsl:with-param name="noparams" select="../../@noParams"/>
216 <xsl:with-param name="target" select="1"/>
217 </xsl:apply-templates>
222 </InductiveDefinition>
225 <xsl:template match="Variable" mode="noannot">
226 <Variable name="{@name}" helm:xref="{@id}">
227 <xsl:if test="name(*[1])='body'">
229 <xsl:apply-templates select="body/*[1]"/>
233 <xsl:apply-templates select="type/*[1]"/>