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