]> matita.cs.unibo.it Git - helm.git/blob - helm/style/mk_meta_theory.xsl
* Title added
[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>
37                  <title>Occurrences of <xsl:value-of select="occurs/@who"/></title>
38                 </head>
39                 <!-- CSC: method onLoad to be removed once the window -->
40                 <!-- CSC: becomes a frame                              -->
41                 <body bgcolor="white" onLoad="window.focus()">
42                 <xsl:apply-templates/>
43                 </body>
44                </html>
45 </xsl:template>
46
47 <xsl:template match="occurs">
48  <xsl:variable name="no_main" select="count(main)"/>
49  <xsl:variable name="no_concl" select="count(in_conclusion)"/>
50  <xsl:variable name="no_main_hyp" select="count(main_hypothesis)"/>
51  <xsl:variable name="no_in_hyp" select="count(in_hypothesis)"/>
52  <xsl:variable name="no_body" select="count(in_body)"/>
53  <h1>Occurrences of <xsl:value-of select="@who"/></h1>
54  
55  <ul>
56        <xsl:if test="$no_main != 0">
57         <li><a href ="#main">Head position in conclusion 
58             (<xsl:value-of select="$no_main"/>)</a></li>
59        </xsl:if>
60        <xsl:if test="$no_concl != 0">
61         <li><a href ="#concl">In conclusion 
62             (<xsl:value-of select="$no_concl"/>)</a></li>
63        </xsl:if>
64        <xsl:if test="$no_main_hyp != 0">
65         <li><a href ="#main_hyp">Head position in some hypothesis
66             (<xsl:value-of select="$no_main_hyp"/>)</a></li>
67        </xsl:if>
68        <xsl:if test="$no_in_hyp != 0">
69         <li><a href ="#hyp">In hypotheses
70             (<xsl:value-of select="$no_in_hyp"/>)</a></li>
71        </xsl:if>
72        <xsl:if test="$no_body != 0">
73         <li><a href ="#body">In the body
74             (<xsl:value-of select="$no_body"/>)</a></li>
75        </xsl:if>
76  </ul>
77  <xsl:choose>
78   <xsl:when test="$no_main = 0"/>
79   <xsl:when test="15 > $no_main">
80    <h2><a name="main">Head position inside conclusion:</a></h2>
81    <xsl:for-each select="main">
82     <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
83      <ht:OBJECT uri="{@uri}" mode="typeonly"/>
84     </div>
85    </xsl:for-each>
86   </xsl:when>
87   <xsl:when test="$no_main >= 15">
88    <h2><a name="main">Head position inside conclusion:</a></h2>
89    <xsl:for-each select="main">
90     <div style="margin: 0cm 0cm 0cm 0.75cm">
91      <ht:OBJECT uri="{@uri}" mode="linkonly"/>
92     </div>
93    </xsl:for-each>
94   </xsl:when>
95  </xsl:choose>
96  <xsl:choose>
97   <xsl:when test="$no_concl = 0"/>
98   <xsl:when test="15 > $no_concl">
99    <h2><a name="concl">Inside conclusion:</a></h2>
100    <xsl:for-each select="in_conclusion">
101     <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
102      <ht:OBJECT uri="{@uri}" mode="typeonly"/>
103     </div>
104    </xsl:for-each>
105   </xsl:when>
106   <xsl:when test="$no_concl >= 15">
107    <h2><a name="concl">Inside conclusion:</a></h2>
108    <xsl:for-each select="in_conclusion">
109     <div style="margin: 0cm 0cm 0cm 0.75cm">
110      <ht:OBJECT uri="{@uri}" mode="linkonly"/>
111     </div>
112    </xsl:for-each>
113   </xsl:when>
114  </xsl:choose>
115  <xsl:choose>
116   <xsl:when test="$no_main_hyp = 0"/>
117   <xsl:when test="15 > $no_main_hyp">
118    <h2><a name="main_hyp">Head position inside an hypothesis:</a></h2>
119    <xsl:for-each select="main_hypothesis">
120     <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
121      <ht:OBJECT uri="{@uri}" mode="typeonly"/>
122     </div>
123    </xsl:for-each>
124   </xsl:when>
125   <xsl:when test="$no_main_hyp >= 15">
126    <h2><a name="main_hyp">Head position inside an hypothesis:</a></h2>
127    <xsl:for-each select="main_hypothesis">
128     <div style="margin: 0cm 0cm 0cm 0.75cm">
129      <ht:OBJECT uri="{@uri}" mode="linkonly"/>
130     </div>
131    </xsl:for-each>
132   </xsl:when> 
133  </xsl:choose>
134  <xsl:choose>
135   <xsl:when test="$no_in_hyp = 0"/>
136   <xsl:when test="15 > $no_in_hyp">
137    <h2><a name="hyp">Inside an hypothesis:</a></h2>
138    <xsl:for-each select="in_hypothesis">
139     <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
140      <ht:OBJECT uri="{@uri}" mode="typeonly"/>
141     </div>
142    </xsl:for-each>
143   </xsl:when>
144   <xsl:when test="$no_in_hyp >= 15">
145    <h2><a name="hyp">Inside an hypothesis:</a></h2>
146    <xsl:for-each select="in_hypothesis">
147     <div style="margin: 0cm 0cm 0cm 0.75cm">
148      <ht:OBJECT uri="{@uri}" mode="linkonly"/>
149     </div>
150    </xsl:for-each>
151   </xsl:when>
152  </xsl:choose>
153  <xsl:if test="in_body">
154   <h2><a name="body">Inside the body:</a></h2>
155   <xsl:for-each select="in_body">
156    <div style="margin: 0cm 0cm 0cm 0.75cm">
157     <ht:OBJECT uri="{@uri}" mode="linkonly"/>
158    </div>
159   </xsl:for-each>
160  </xsl:if>
161 </xsl:template>
162
163 <!-- 
164 <xsl:template match="occurs">
165  <xsl:if test="main">
166   <h2>Head position inside conclusion:</h2>
167   <xsl:for-each select="main">
168    <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
169     <ht:OBJECT uri="{@uri}" mode="typeonly"/>
170    </div>
171   </xsl:for-each>
172  </xsl:if>
173  <xsl:if test="in_conclusion">
174   <h2>Inside conclusion:</h2>
175   <xsl:for-each select="in_conclusion">
176    <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
177     <ht:OBJECT uri="{@uri}" mode="typeonly"/>
178    </div>
179   </xsl:for-each>
180  </xsl:if>
181  <xsl:if test="main_hypothesis">
182   <h2>Head position inside an hypothesis:</h2>
183   <xsl:for-each select="main_hypothesis">
184    <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
185     <ht:OBJECT uri="{@uri}" mode="typeonly"/>
186    </div>
187   </xsl:for-each>
188  </xsl:if>
189  <xsl:if test="in_hypothesis">
190   <h2>Inside an hypothesis:</h2>
191   <xsl:for-each select="in_hypothesis">
192    <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
193     <ht:OBJECT uri="{@uri}" mode="typeonly"/>
194    </div>
195   </xsl:for-each>
196  </xsl:if>
197  <xsl:if test="in_body">
198   <h2>Inside the body:</h2>
199   <xsl:for-each select="in_body">
200    <div style="margin: 0cm 0cm 0cm 0.75cm">
201     <ht:OBJECT uri="{@uri}" mode="linkonly"/>
202    </div>
203   </xsl:for-each>
204  </xsl:if>
205 </xsl:template>
206 -->
207
208
209 </xsl:stylesheet>