]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/mk_meta_theory.xsl
Initial revision
[helm.git] / helm / style / mk_meta_theory.xsl
index bdae203af7837ef0c9827c468c1bc3b0a1cb1ffb..3a07962a920fade8a8d414cd0d4e4dd265bac3f1 100644 (file)
 <!-- For details, see the HELM World-Wide-Web page,                    -->
 <!-- http://cs.unibo.it/helm/.                                         -->
 
-<xsl:stylesheet version="0.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                              xmlns:ht="http://www.cs.unibo.it/helm/namespaces/helm-theory">
-
-<!-- ALL REQUIRED PARAMS ARE ALREADY DEFINED INSIDE links_library.xsl -->
-
-<!-- <xsl:import href="links_library.xsl"/> -->
+<xsl:stylesheet version="1.0"
+   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+   xmlns:ht="http://www.cs.unibo.it/helm/namespaces/helm-theory"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:h="http:/www.cs.unibo.it/helm/schemas/schema-h.rdf#">
+
+<xsl:variable name="MainConclusion" select="'http://www.cs.unibo.it/helm/schemas/schema-h.rdf#MainConclusion'"/>
+<xsl:variable name="InConclusion" select="'http://www.cs.unibo.it/helm/schemas/schema-h.rdf#InConclusion'"/>
+<xsl:variable name="MainHypothesis" select="'http://www.cs.unibo.it/helm/schemas/schema-h.rdf#MainHypothesis'"/>
+<xsl:variable name="InHypothesis" select="'http://www.cs.unibo.it/helm/schemas/schema-h.rdf#InHypothesis'"/>
+<xsl:variable name="InBody" select="'http://www.cs.unibo.it/helm/schemas/schema-h.rdf#InBody'"/>
 
 <xsl:template match="/">
                <html> 
-                <head></head>
-                <body bgcolor="white">
+                <head>
+                 <title>Occurrences of <xsl:value-of select="*/*/@rdf:value"/></title>
+                 <style>
+                  a { text-decoration: none }
+                  a.underline {text-decoration: underline }
+                 </style>
+                </head>
+                <!-- CSC: method onLoad to be removed once the window -->
+                <!-- CSC: becomes a frame                              -->
+                <body bgcolor="white" onLoad="window.focus()">
                 <xsl:apply-templates/>
                 </body>
                </html>
 </xsl:template>
 
-<xsl:template match="occurs">
- <xsl:variable name="no_main" select="count(main)"/>
- <xsl:variable name="no_concl" select="count(in_conclusion)"/>
- <xsl:variable name="no_main_hyp" select="count(main_hypothesis)"/>
- <xsl:variable name="no_in_hyp" select="count(in_hypothesis)"/>
- <xsl:variable name="no_body" select="count(in_body)"/>
- <h1>Occurrences of <xsl:value-of select="@who"/></h1>
+<xsl:template match="h:Object">
+ <xsl:variable name="no_main"
+   select="count(*/h:Occurrence[@rdf:about=$MainConclusion])"/>
+ <xsl:variable name="no_concl"
+   select="count(*/h:Occurrence[@rdf:about=$InConclusion])"/>
+ <xsl:variable name="no_main_hyp"
+   select="count(*/h:Occurrence[@rdf:about=$MainHypothesis])"/>
+ <xsl:variable name="no_in_hyp"
+   select="count(*/h:Occurrence[@rdf:about=$InHypothesis])"/>
+ <xsl:variable name="no_body"
+   select="count(*/h:Occurrence[@rdf:about=$InBody])"/>
+ <h1>Occurrences of <xsl:value-of select="@rdf:about"/></h1>
  
  <ul>
        <xsl:if test="$no_main != 0">
-       <li><a href ="#main">Head position in conclusion 
+       <li><a class="underline" href ="#main">Head position in conclusion 
             (<xsl:value-of select="$no_main"/>)</a></li>
        </xsl:if>
        <xsl:if test="$no_concl != 0">
-       <li><a href ="#concl">In conclusion 
+       <li><a class="underline" href ="#concl">In conclusion 
             (<xsl:value-of select="$no_concl"/>)</a></li>
        </xsl:if>
        <xsl:if test="$no_main_hyp != 0">
-       <li><a href ="#main_hyp">Head position in some hypothesis
+       <li><a class="underline" href ="#main_hyp">Head position in some hypothesis
             (<xsl:value-of select="$no_main_hyp"/>)</a></li>
        </xsl:if>
        <xsl:if test="$no_in_hyp != 0">
-       <li><a href ="#hyp">In hypotheses
+       <li><a class="underline" href ="#hyp">In hypotheses
             (<xsl:value-of select="$no_in_hyp"/>)</a></li>
        </xsl:if>
        <xsl:if test="$no_body != 0">
-       <li><a href ="#body">In the body
+       <li><a class="underline" href ="#body">In the body
             (<xsl:value-of select="$no_body"/>)</a></li>
        </xsl:if>
  </ul>
   <xsl:when test="$no_main = 0"/>
   <xsl:when test="15 > $no_main">
    <h2><a name="main">Head position inside conclusion:</a></h2>
-   <xsl:for-each select="main">
+   <xsl:for-each select="*/h:Occurrence[@rdf:about=$MainConclusion]">
     <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
-     <ht:OBJECT uri="{@uri}" mode="typeonly"/>
+     <ht:OBJECT uri="{@rdf:value}" mode="typeonly"/>
     </div>
    </xsl:for-each>
   </xsl:when>
   <xsl:when test="$no_main >= 15">
    <h2><a name="main">Head position inside conclusion:</a></h2>
-   <xsl:for-each select="main">
+   <xsl:for-each select="*/h:Occurrence[@rdf:about=$MainConclusion]">
     <div style="margin: 0cm 0cm 0cm 0.75cm">
-     <ht:OBJECT uri="{@uri}" mode="linkonly"/>
+     <ht:OBJECT uri="{@rdf:value}" mode="linkonly"/>
     </div>
    </xsl:for-each>
   </xsl:when>
   <xsl:when test="$no_concl = 0"/>
   <xsl:when test="15 > $no_concl">
    <h2><a name="concl">Inside conclusion:</a></h2>
-   <xsl:for-each select="in_conclusion">
+   <xsl:for-each select="*/h:Occurrence[@rdf:about=$InConclusion]">
     <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
-     <ht:OBJECT uri="{@uri}" mode="typeonly"/>
+     <ht:OBJECT uri="{@rdf:value}" mode="typeonly"/>
     </div>
    </xsl:for-each>
   </xsl:when>
   <xsl:when test="$no_concl >= 15">
    <h2><a name="concl">Inside conclusion:</a></h2>
-   <xsl:for-each select="in_conclusion">
+   <xsl:for-each select="*/h:Occurrence[@rdf:about=$InConclusion]">
     <div style="margin: 0cm 0cm 0cm 0.75cm">
-     <ht:OBJECT uri="{@uri}" mode="linkonly"/>
+     <ht:OBJECT uri="{@rdf:value}" mode="linkonly"/>
     </div>
    </xsl:for-each>
   </xsl:when>
   <xsl:when test="$no_main_hyp = 0"/>
   <xsl:when test="15 > $no_main_hyp">
    <h2><a name="main_hyp">Head position inside an hypothesis:</a></h2>
-   <xsl:for-each select="main_hypothesis">
+   <xsl:for-each select="*/h:Occurrence[@rdf:about=$MainHypothesis]">
     <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
-     <ht:OBJECT uri="{@uri}" mode="typeonly"/>
+     <ht:OBJECT uri="{@rdf:value}" mode="typeonly"/>
     </div>
    </xsl:for-each>
   </xsl:when>
   <xsl:when test="$no_main_hyp >= 15">
    <h2><a name="main_hyp">Head position inside an hypothesis:</a></h2>
-   <xsl:for-each select="main_hypothesis">
+   <xsl:for-each select="*/h:Occurrence[@rdf:about=$MainHypothesis]">
     <div style="margin: 0cm 0cm 0cm 0.75cm">
-     <ht:OBJECT uri="{@uri}" mode="linkonly"/>
+     <ht:OBJECT uri="{@rdf:value}" mode="linkonly"/>
     </div>
    </xsl:for-each>
   </xsl:when> 
   <xsl:when test="$no_in_hyp = 0"/>
   <xsl:when test="15 > $no_in_hyp">
    <h2><a name="hyp">Inside an hypothesis:</a></h2>
-   <xsl:for-each select="in_hypothesis">
+   <xsl:for-each select="*/h:Occurrence[@rdf:about=$InHypothesis]">
     <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
-     <ht:OBJECT uri="{@uri}" mode="typeonly"/>
+     <ht:OBJECT uri="{@rdf:value}" mode="typeonly"/>
     </div>
    </xsl:for-each>
   </xsl:when>
   <xsl:when test="$no_in_hyp >= 15">
    <h2><a name="hyp">Inside an hypothesis:</a></h2>
-   <xsl:for-each select="in_hypothesis">
+   <xsl:for-each select="*/h:Occurrence[@rdf:about=$InHypothesis]">
     <div style="margin: 0cm 0cm 0cm 0.75cm">
-     <ht:OBJECT uri="{@uri}" mode="linkonly"/>
+     <ht:OBJECT uri="{@rdf:value}" mode="linkonly"/>
     </div>
    </xsl:for-each>
   </xsl:when>
  </xsl:choose>
- <xsl:if test="in_body">
+ <xsl:if test="$no_body > 0">
   <h2><a name="body">Inside the body:</a></h2>
-  <xsl:for-each select="in_body">
-   <div style="margin: 0cm 0cm 0cm 0.75cm">
-    <ht:OBJECT uri="{@uri}" mode="linkonly"/>
-   </div>
-  </xsl:for-each>
- </xsl:if>
-</xsl:template>
-
-<!-- 
-<xsl:template match="occurs">
- <xsl:if test="main">
-  <h2>Head position inside conclusion:</h2>
-  <xsl:for-each select="main">
-   <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
-    <ht:OBJECT uri="{@uri}" mode="typeonly"/>
-   </div>
-  </xsl:for-each>
- </xsl:if>
- <xsl:if test="in_conclusion">
-  <h2>Inside conclusion:</h2>
-  <xsl:for-each select="in_conclusion">
-   <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
-    <ht:OBJECT uri="{@uri}" mode="typeonly"/>
-   </div>
-  </xsl:for-each>
- </xsl:if>
- <xsl:if test="main_hypothesis">
-  <h2>Head position inside an hypothesis:</h2>
-  <xsl:for-each select="main_hypothesis">
-   <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
-    <ht:OBJECT uri="{@uri}" mode="typeonly"/>
-   </div>
-  </xsl:for-each>
- </xsl:if>
- <xsl:if test="in_hypothesis">
-  <h2>Inside an hypothesis:</h2>
-  <xsl:for-each select="in_hypothesis">
-   <div style="margin: 0.25cm 0cm 0.25cm 0.75cm">
-    <ht:OBJECT uri="{@uri}" mode="typeonly"/>
-   </div>
-  </xsl:for-each>
- </xsl:if>
- <xsl:if test="in_body">
-  <h2>Inside the body:</h2>
-  <xsl:for-each select="in_body">
+  <xsl:for-each select="*/h:Occurrence[@rdf:about=$InBody]">
    <div style="margin: 0cm 0cm 0cm 0.75cm">
-    <ht:OBJECT uri="{@uri}" mode="linkonly"/>
+    <ht:OBJECT uri="{@rdf:value}" mode="linkonly"/>
    </div>
   </xsl:for-each>
  </xsl:if>
 </xsl:template>
--->
-
 
 </xsl:stylesheet>
-
-
-
-
-
-
-
-
-
-
-
-
-