]> matita.cs.unibo.it Git - helm.git/blob - helm/style/mk_meta_theory.xsl
Version 1.2.1beta => 1.2.1
[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"
28    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
29    xmlns:ht="http://www.cs.unibo.it/helm/namespaces/helm-theory"
30    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
31    xmlns:h="http:/www.cs.unibo.it/helm/schemas/schema-h.rdf#">
32
33 <xsl:variable name="MainConclusion" select="'http://www.cs.unibo.it/helm/schemas/schema-h.rdf#MainConclusion'"/>
34 <xsl:variable name="InConclusion" select="'http://www.cs.unibo.it/helm/schemas/schema-h.rdf#InConclusion'"/>
35 <xsl:variable name="MainHypothesis" select="'http://www.cs.unibo.it/helm/schemas/schema-h.rdf#MainHypothesis'"/>
36 <xsl:variable name="InHypothesis" select="'http://www.cs.unibo.it/helm/schemas/schema-h.rdf#InHypothesis'"/>
37 <xsl:variable name="InBody" select="'http://www.cs.unibo.it/helm/schemas/schema-h.rdf#InBody'"/>
38
39 <xsl:template match="/">
40                <html> 
41                 <head>
42                  <title>Occurrences of <xsl:value-of select="*/*/@rdf:value"/></title>
43                 </head>
44                 <!-- CSC: method onLoad to be removed once the window -->
45                 <!-- CSC: becomes a frame                              -->
46                 <body bgcolor="white" onLoad="window.focus()">
47                 <xsl:apply-templates/>
48                 </body>
49                </html>
50 </xsl:template>
51
52 <xsl:template match="h:Object">
53  <xsl:variable name="no_main"
54    select="count(*/h:Occurrence[@rdf:about=$MainConclusion])"/>
55  <xsl:variable name="no_concl"
56    select="count(*/h:Occurrence[@rdf:about=$InConclusion])"/>
57  <xsl:variable name="no_main_hyp"
58    select="count(*/h:Occurrence[@rdf:about=$MainHypothesis])"/>
59  <xsl:variable name="no_in_hyp"
60    select="count(*/h:Occurrence[@rdf:about=$InHypothesis])"/>
61  <xsl:variable name="no_body"
62    select="count(*/h:Occurrence[@rdf:about=$InBody])"/>
63  <h1>Occurrences of <xsl:value-of select="@rdf:about"/></h1>
64  
65  <ul>
66        <xsl:if test="$no_main != 0">
67         <li><a href ="#main">Head position in conclusion 
68             (<xsl:value-of select="$no_main"/>)</a></li>
69        </xsl:if>
70        <xsl:if test="$no_concl != 0">
71         <li><a href ="#concl">In conclusion 
72             (<xsl:value-of select="$no_concl"/>)</a></li>
73        </xsl:if>
74        <xsl:if test="$no_main_hyp != 0">
75         <li><a href ="#main_hyp">Head position in some hypothesis
76             (<xsl:value-of select="$no_main_hyp"/>)</a></li>
77        </xsl:if>
78        <xsl:if test="$no_in_hyp != 0">
79         <li><a href ="#hyp">In hypotheses
80             (<xsl:value-of select="$no_in_hyp"/>)</a></li>
81        </xsl:if>
82        <xsl:if test="$no_body != 0">
83         <li><a href ="#body">In the body
84             (<xsl:value-of select="$no_body"/>)</a></li>
85        </xsl:if>
86  </ul>
87  <xsl:choose>
88   <xsl:when test="$no_main = 0"/>
89   <xsl:when test="15 > $no_main">
90    <h2><a name="main">Head position inside conclusion:</a></h2>
91    <xsl:for-each select="*/h:Occurrence[@rdf:about=$MainConclusion]">
92     <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
93      <ht:OBJECT uri="{@rdf:value}" mode="typeonly"/>
94     </div>
95    </xsl:for-each>
96   </xsl:when>
97   <xsl:when test="$no_main >= 15">
98    <h2><a name="main">Head position inside conclusion:</a></h2>
99    <xsl:for-each select="*/h:Occurrence[@rdf:about=$MainConclusion]">
100     <div style="margin: 0cm 0cm 0cm 0.75cm">
101      <ht:OBJECT uri="{@rdf:value}" mode="linkonly"/>
102     </div>
103    </xsl:for-each>
104   </xsl:when>
105  </xsl:choose>
106  <xsl:choose>
107   <xsl:when test="$no_concl = 0"/>
108   <xsl:when test="15 > $no_concl">
109    <h2><a name="concl">Inside conclusion:</a></h2>
110    <xsl:for-each select="*/h:Occurrence[@rdf:about=$InConclusion]">
111     <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
112      <ht:OBJECT uri="{@rdf:value}" mode="typeonly"/>
113     </div>
114    </xsl:for-each>
115   </xsl:when>
116   <xsl:when test="$no_concl >= 15">
117    <h2><a name="concl">Inside conclusion:</a></h2>
118    <xsl:for-each select="*/h:Occurrence[@rdf:about=$InConclusion]">
119     <div style="margin: 0cm 0cm 0cm 0.75cm">
120      <ht:OBJECT uri="{@rdf:value}" mode="linkonly"/>
121     </div>
122    </xsl:for-each>
123   </xsl:when>
124  </xsl:choose>
125  <xsl:choose>
126   <xsl:when test="$no_main_hyp = 0"/>
127   <xsl:when test="15 > $no_main_hyp">
128    <h2><a name="main_hyp">Head position inside an hypothesis:</a></h2>
129    <xsl:for-each select="*/h:Occurrence[@rdf:about=$MainHypothesis]">
130     <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
131      <ht:OBJECT uri="{@rdf:value}" mode="typeonly"/>
132     </div>
133    </xsl:for-each>
134   </xsl:when>
135   <xsl:when test="$no_main_hyp >= 15">
136    <h2><a name="main_hyp">Head position inside an hypothesis:</a></h2>
137    <xsl:for-each select="*/h:Occurrence[@rdf:about=$MainHypothesis]">
138     <div style="margin: 0cm 0cm 0cm 0.75cm">
139      <ht:OBJECT uri="{@rdf:value}" mode="linkonly"/>
140     </div>
141    </xsl:for-each>
142   </xsl:when> 
143  </xsl:choose>
144  <xsl:choose>
145   <xsl:when test="$no_in_hyp = 0"/>
146   <xsl:when test="15 > $no_in_hyp">
147    <h2><a name="hyp">Inside an hypothesis:</a></h2>
148    <xsl:for-each select="*/h:Occurrence[@rdf:about=$InHypothesis]">
149     <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
150      <ht:OBJECT uri="{@rdf:value}" mode="typeonly"/>
151     </div>
152    </xsl:for-each>
153   </xsl:when>
154   <xsl:when test="$no_in_hyp >= 15">
155    <h2><a name="hyp">Inside an hypothesis:</a></h2>
156    <xsl:for-each select="*/h:Occurrence[@rdf:about=$InHypothesis]">
157     <div style="margin: 0cm 0cm 0cm 0.75cm">
158      <ht:OBJECT uri="{@rdf:value}" mode="linkonly"/>
159     </div>
160    </xsl:for-each>
161   </xsl:when>
162  </xsl:choose>
163  <xsl:if test="$no_body > 0">
164   <h2><a name="body">Inside the body:</a></h2>
165   <xsl:for-each select="*/h:Occurrence[@rdf:about=$InBody]">
166    <div style="margin: 0cm 0cm 0cm 0.75cm">
167     <ht:OBJECT uri="{@rdf:value}" mode="linkonly"/>
168    </div>
169   </xsl:for-each>
170  </xsl:if>
171 </xsl:template>
172
173 </xsl:stylesheet>