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