]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/html_init.xsl
New stylesheets from content to html.
[helm.git] / helm / style / html_init.xsl
index bb6bea3ba064347478c777b5c9c2f91d6c1b65fa..f52525ebf3eb80f20a52e190a542c97ecd35dcff 100644 (file)
 <!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                      -->
 <!--***********************************************************************--> 
 
+<!-- INLINE MODE : BASIC OPERATORS -->
+
+ <xsl:template mode="inline" match="m:apply[m:and|m:or|m:eq|m:neq|m:leq|m:lt
+       |m:geq|m:gt|m:plus|m:times]">
+  <xsl:variable name="uri">
+   <xsl:value-of select="*[1]/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="symbol">
+   <xsl:choose>
+    <xsl:when test="m:and">
+     <xsl:value-of select="'&#217;'"/>
+    </xsl:when>
+    <xsl:when test="m:or">
+     <xsl:value-of select="'&#218;'"/>
+    </xsl:when>
+    <xsl:when test="m:eq">
+     <xsl:value-of select="'&#61;'"/>
+    </xsl:when>
+    <xsl:when test="m:neq">
+     <xsl:value-of select="'&#185;'"/>
+    </xsl:when>
+    <xsl:when test="m:leq">
+     <xsl:value-of select="'&#163;'"/>
+    </xsl:when>
+    <xsl:when test="m:lt">
+     <xsl:value-of select="'&#60;'"/>
+    </xsl:when>
+    <xsl:when test="m:geq">
+     <xsl:value-of select="'&#179;'"/>
+    </xsl:when>
+    <xsl:when test="m:gt">
+     <xsl:value-of select="'&#62;'"/>
+    </xsl:when>
+    <xsl:when test="m:plus">
+     <xsl:value-of select="'&#43;'"/>
+    </xsl:when>
+    <xsl:when test="m:times">
+     <xsl:value-of select="'&#42;'"/>
+    </xsl:when>
+   </xsl:choose>
+  </xsl:variable>
+  <xsl:text>(</xsl:text>
+  <xsl:apply-templates mode="inline" select="*[2]"/>
+  <a>
+   <xsl:attribute name="href">
+    <xsl:value-of select="concat(string($header),string($uri))"/>
+   </xsl:attribute>
+   <FONT FACE="symbol" mathcolor="blue">
+    <xsl:value-of select="$symbol"/>
+   </FONT>
+  </a>
+  <xsl:apply-templates mode="inline" select="*[3]"/>
+  <xsl:text>)</xsl:text>
+ </xsl:template>
+
+<!-- INLINE MODE - MINUS (can be unary!) -->
+
+<xsl:template mode="inline" match="m:apply[m:minus]">
+  <xsl:variable name="uri">
+   <xsl:value-of select="*[1]/@definitionURL"/>
+  </xsl:variable>
+  <xsl:choose>
+   <xsl:when test="count(child::*)=2">
+    <a>
+    <xsl:attribute name="href">
+     <xsl:value-of select="concat(string($header),string($uri))"/>
+    </xsl:attribute>
+    <xsl:text>-</xsl:text>
+    </a>
+    <xsl:apply-templates mode="inline" select="*[2]"/>
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:text>(</xsl:text>
+    <xsl:apply-templates mode="inline" select="*[2]"/>
+    <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <xsl:text>-</xsl:text>
+    </a>
+    <xsl:apply-templates mode="inline" select="*[3]"/>
+    <xsl:text>)</xsl:text>
+   </xsl:otherwise>
+  </xsl:choose>
+ </xsl:template>
+
+<!-- INLINE MODE NOT -->
+
+ <xsl:template mode="inline" match="m:apply[m:not]">
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:not/@definitionURL"/>
+  </xsl:variable>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <FONT FACE="symbol" mathcolor="blue">&#216;</FONT>
+     </a>
+     <xsl:apply-templates mode="inline" select="*[2]"/>
+ </xsl:template>
+
+<!-- INLINE MODE EXISTS -->
+
+ <xsl:template mode="inline" match="m:apply[m:exists]">
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:exists/@definitionURL"/>
+  </xsl:variable>
+  <a>
+   <xsl:attribute name="href">
+    <xsl:value-of select="concat(string($header),string($uri))"/>
+   </xsl:attribute>
+   <FONT FACE="symbol" mathcolor="blue">&#36;</FONT>
+  </a>
+  <xsl:apply-templates select="m:bvar/m:ci"/>
+  <xsl:text>:</xsl:text>
+  <xsl:apply-templates mode="inline" select="m:condition"/>
+  <xsl:text>.</xsl:text>
+  <xsl:apply-templates mode="inline" select="*[last()]"/>
+ </xsl:template>
+
+<!-- COUNTING MODE -->
+
 <!-- BASIC OPERATORS -->
 
  <xsl:template match="m:apply[m:and|m:or|m:eq|m:neq|m:leq|m:lt
      <xsl:text>)</xsl:text>
     </xsl:when>
     <xsl:otherwise>
-     <xsl:text>(</xsl:text>
-     <xsl:apply-templates select="*[2]"/>
-     <a>
-     <xsl:attribute name="href">
-      <xsl:value-of select="concat(string($header),string($uri))"/>
-     </xsl:attribute>
-     <FONT FACE="symbol" mathcolor="blue">
-     <xsl:value-of select="$symbol"/>
-     </FONT>
-     </a>
-     <xsl:apply-templates select="*[3]"/>
-     <xsl:text>)</xsl:text>
+     <xsl:apply-templates mode="inline" select="."/>
     </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
       <xsl:text>)</xsl:text>
      </xsl:when>
      <xsl:otherwise>
-      <xsl:text>(</xsl:text>
-      <xsl:apply-templates select="*[2]"/>
-      <a>
-      <xsl:attribute name="href">
-       <xsl:value-of select="concat(string($header),string($uri))"/>
-      </xsl:attribute>
-      <xsl:text>-</xsl:text>
-      </a>
-      <xsl:apply-templates select="*[3]"/>
-      <xsl:text>)</xsl:text>
+      <xsl:apply-templates mode="inline" select="."/>
      </xsl:otherwise>
     </xsl:choose>
    </xsl:otherwise>
       </xsl:apply-templates>
     </xsl:when>
     <xsl:otherwise>
-     <a>
-     <xsl:attribute name="href">
-      <xsl:value-of select="concat(string($header),string($uri))"/>
-     </xsl:attribute>
-     <FONT FACE="symbol" mathcolor="blue">&#36;</FONT>
-     </a>
-     <xsl:apply-templates select="m:bvar/m:ci"/>
-     <xsl:text>:</xsl:text>
-     <xsl:apply-templates select="m:condition"/>
-     <xsl:text>.</xsl:text>
-     <xsl:apply-templates select="*[last()]">
-      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
-     </xsl:apply-templates>
+     <xsl:apply-templates mode="inline" select="."/>
     </xsl:otherwise>
    </xsl:choose>
  </xsl:template>