]> matita.cs.unibo.it Git - helm.git/blob - helm/style/mk_meta_theory.xsl
----------------------------------------------------------------------
[helm.git] / helm / style / mk_meta_theory.xsl
1 <?xml version="1.0"?>
2
3 <!-- Copyright (C) 2000, HELM Team                                     -->
4 <!--                                                                   -->
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.                         -->
8 <!--                                                                   -->
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.            -->
13 <!--                                                                   -->
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.                      -->
18 <!--                                                                   -->
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.                                              -->
23 <!--                                                                   -->
24 <!-- For details, see the HELM World-Wide-Web page,                    -->
25 <!-- http://cs.unibo.it/helm/.                                         -->
26
27 <xsl:stylesheet version="0.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
28                               xmlns:ht="http://www.cs.unibo.it/helm/namespaces/helm-theory">
29
30 <!-- ALL REQUIRED PARAMS ARE ALREADY DEFINED INSIDE links_library.xsl -->
31
32 <!-- <xsl:import href="links_library.xsl"/> -->
33
34 <xsl:template match="/">
35                <html> 
36                 <head></head>
37                 <body bgcolor="white">
38                 <xsl:apply-templates/>
39                 </body>
40                </html>
41 </xsl:template>
42
43 <xsl:template match="occurs">
44  <xsl:variable name="no_main" select="count(main)"/>
45  <xsl:variable name="no_concl" select="count(in_conclusion)"/>
46  <xsl:variable name="no_main_hyp" select="count(main_hypothesis)"/>
47  <xsl:variable name="no_in_hyp" select="count(in_hypothesis)"/>
48  <xsl:variable name="no_body" select="count(in_body)"/>
49  <h1>Occurrences of <xsl:value-of select="@who"/></h1>
50  
51  <ul>
52        <xsl:if test="$no_main != 0">
53         <li><a href ="#main">Head position in conclusion 
54             (<xsl:value-of select="$no_main"/>)</a></li>
55        </xsl:if>
56        <xsl:if test="$no_concl != 0">
57         <li><a href ="#concl">In conclusion 
58             (<xsl:value-of select="$no_concl"/>)</a></li>
59        </xsl:if>
60        <xsl:if test="$no_main_hyp != 0">
61         <li><a href ="#main_hyp">Head position in some hypothesis
62             (<xsl:value-of select="$no_main_hyp"/>)</a></li>
63        </xsl:if>
64        <xsl:if test="$no_in_hyp != 0">
65         <li><a href ="#hyp">In hypotheses
66             (<xsl:value-of select="$no_in_hyp"/>)</a></li>
67        </xsl:if>
68        <xsl:if test="$no_body != 0">
69         <li><a href ="#body">In the body
70             (<xsl:value-of select="$no_body"/>)</a></li>
71        </xsl:if>
72  </ul>
73  <xsl:choose>
74   <xsl:when test="$no_main = 0"/>
75   <xsl:when test="15 > $no_main">
76    <h2><a name="main">Head position inside conclusion:</a></h2>
77    <xsl:for-each select="main">
78     <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
79      <ht:OBJECT uri="{@uri}" mode="typeonly"/>
80     </div>
81    </xsl:for-each>
82   </xsl:when>
83   <xsl:when test="$no_main >= 15">
84    <h2><a name="main">Head position inside conclusion:</a></h2>
85    <xsl:for-each select="main">
86     <div style="margin: 0cm 0cm 0cm 0.75cm">
87      <ht:OBJECT uri="{@uri}" mode="linkonly"/>
88     </div>
89    </xsl:for-each>
90   </xsl:when>
91  </xsl:choose>
92  <xsl:choose>
93   <xsl:when test="$no_concl = 0"/>
94   <xsl:when test="15 > $no_concl">
95    <h2><a name="concl">Inside conclusion:</a></h2>
96    <xsl:for-each select="in_conclusion">
97     <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
98      <ht:OBJECT uri="{@uri}" mode="typeonly"/>
99     </div>
100    </xsl:for-each>
101   </xsl:when>
102   <xsl:when test="$no_concl >= 15">
103    <h2><a name="concl">Inside conclusion:</a></h2>
104    <xsl:for-each select="in_conclusion">
105     <div style="margin: 0cm 0cm 0cm 0.75cm">
106      <ht:OBJECT uri="{@uri}" mode="linkonly"/>
107     </div>
108    </xsl:for-each>
109   </xsl:when>
110  </xsl:choose>
111  <xsl:choose>
112   <xsl:when test="$no_main_hyp = 0"/>
113   <xsl:when test="15 > $no_main_hyp">
114    <h2><a name="main_hyp">Head position inside an hypothesis:</a></h2>
115    <xsl:for-each select="main_hypothesis">
116     <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
117      <ht:OBJECT uri="{@uri}" mode="typeonly"/>
118     </div>
119    </xsl:for-each>
120   </xsl:when>
121   <xsl:when test="$no_main_hyp >= 15">
122    <h2><a name="main_hyp">Head position inside an hypothesis:</a></h2>
123    <xsl:for-each select="main_hypothesis">
124     <div style="margin: 0cm 0cm 0cm 0.75cm">
125      <ht:OBJECT uri="{@uri}" mode="linkonly"/>
126     </div>
127    </xsl:for-each>
128   </xsl:when> 
129  </xsl:choose>
130  <xsl:choose>
131   <xsl:when test="$no_in_hyp = 0"/>
132   <xsl:when test="15 > $no_in_hyp">
133    <h2><a name="hyp">Inside an hypothesis:</a></h2>
134    <xsl:for-each select="in_hypothesis">
135     <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
136      <ht:OBJECT uri="{@uri}" mode="typeonly"/>
137     </div>
138    </xsl:for-each>
139   </xsl:when>
140   <xsl:when test="$no_in_hyp >= 15">
141    <h2><a name="hyp">Inside an hypothesis:</a></h2>
142    <xsl:for-each select="in_hypothesis">
143     <div style="margin: 0cm 0cm 0cm 0.75cm">
144      <ht:OBJECT uri="{@uri}" mode="linkonly"/>
145     </div>
146    </xsl:for-each>
147   </xsl:when>
148  </xsl:choose>
149  <xsl:if test="in_body">
150   <h2><a name="body">Inside the body:</a></h2>
151   <xsl:for-each select="in_body">
152    <div style="margin: 0cm 0cm 0cm 0.75cm">
153     <ht:OBJECT uri="{@uri}" mode="linkonly"/>
154    </div>
155   </xsl:for-each>
156  </xsl:if>
157 </xsl:template>
158
159 <!-- 
160 <xsl:template match="occurs">
161  <xsl:if test="main">
162   <h2>Head position inside conclusion:</h2>
163   <xsl:for-each select="main">
164    <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
165     <ht:OBJECT uri="{@uri}" mode="typeonly"/>
166    </div>
167   </xsl:for-each>
168  </xsl:if>
169  <xsl:if test="in_conclusion">
170   <h2>Inside conclusion:</h2>
171   <xsl:for-each select="in_conclusion">
172    <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
173     <ht:OBJECT uri="{@uri}" mode="typeonly"/>
174    </div>
175   </xsl:for-each>
176  </xsl:if>
177  <xsl:if test="main_hypothesis">
178   <h2>Head position inside an hypothesis:</h2>
179   <xsl:for-each select="main_hypothesis">
180    <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
181     <ht:OBJECT uri="{@uri}" mode="typeonly"/>
182    </div>
183   </xsl:for-each>
184  </xsl:if>
185  <xsl:if test="in_hypothesis">
186   <h2>Inside an hypothesis:</h2>
187   <xsl:for-each select="in_hypothesis">
188    <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
189     <ht:OBJECT uri="{@uri}" mode="typeonly"/>
190    </div>
191   </xsl:for-each>
192  </xsl:if>
193  <xsl:if test="in_body">
194   <h2>Inside the body:</h2>
195   <xsl:for-each select="in_body">
196    <div style="margin: 0cm 0cm 0cm 0.75cm">
197     <ht:OBJECT uri="{@uri}" mode="linkonly"/>
198    </div>
199   </xsl:for-each>
200  </xsl:if>
201 </xsl:template>
202 -->
203
204
205 </xsl:stylesheet>