]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/html_reals.xsl
New stylesheets from content to html.
[helm.git] / helm / style / html_reals.xsl
index de3196b128118af37f2538009623f992a92449a5..2b4ca35e5a742f1209f2f58ef128d7e8e99046ab 100644 (file)
 <!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                      -->
 <!--***********************************************************************--> 
 
+<!-- **************************************************************** -->
+<!--                   INLINE MODE                                    -->
+<!-- **************************************************************** -->
+
 <!-- LIMIT -->
 
+
+<xsl:template mode="inline" match="m:apply[m:limit]">
+     <xsl:variable name="uri">
+      <xsl:value-of select="m:limit/@definitionURL"/>
+     </xsl:variable>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <xsl:text>lim</xsl:text>
+     </a>
+     <SUB>
+      <xsl:apply-templates select="m:bvar/m:ci"/>
+      <FONT FACE="symbol" mathcolor="blue">&#174;</FONT>
+      <xsl:apply-templates mode="inline" select="m:lowlimit"/>
+     </SUB>
+     <xsl:apply-templates mode="inline" select="*[4]"/>
+ </xsl:template>
+
+<!-- DIFFERENTIATION -->
+
+<xsl:template mode="inline" match="m:apply[m:diff]">
+     <xsl:variable name="uri">
+      <xsl:value-of select="m:diff/@definitionURL"/>
+     </xsl:variable>
+     <a>
+     <xsl:attribute name="href">
+      <xsl:value-of select="concat(string($header),string($uri))"/>
+     </xsl:attribute>
+     <SUP>d</SUP>
+      <xsl:text>/</xsl:text>
+     <SUB>
+      <xsl:text>d</xsl:text>
+      <xsl:value-of select="m:bvar/m:ci"/>
+     </SUB>
+     </a>
+     <xsl:apply-templates mode="inline" select="*[3]"/>
+ </xsl:template>
+
+<!-- ABSOLUTE VALUE -->
+<xsl:template mode="inline" match="m:apply[m:abs]">
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:abs/@definitionURL"/>
+  </xsl:variable>
+  <xsl:text>|</xsl:text>
+  <xsl:apply-templates mode="inline" select="*[2]"/>
+  <xsl:text>|</xsl:text>
+</xsl:template>
+
+<!-- FACTORIAL -->
+
+<xsl:template mode="inline" match="m:apply[m:fact]">
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:abs/@definitionURL"/>
+  </xsl:variable>
+  <xsl:apply-templates mode="inline" select="*[2]"/>
+  <xsl:text>!</xsl:text>
+</xsl:template>
+
+<!-- SQUARE ROOT -->
+
+<xsl:template match="m:apply[m:root]">
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:abs/@definitionURL"/>
+  </xsl:variable>
+  <xsl:text>(sqr</xsl:text>
+  <xsl:apply-templates mode="inline" select="*[2]"/>
+  <xsl:text>)</xsl:text>
+</xsl:template>
+
+<!-- POWER -->
+
+<xsl:template mode="inline" match="m:apply[m:power]">
+  <xsl:variable name="uri">
+   <xsl:value-of select="m:power/@definitionURL"/>
+  </xsl:variable>
+  <xsl:apply-templates mode="inline" select="*[2]"/>
+  <SUP>
+  <xsl:apply-templates mode="inline" select="*[3]"/>
+  </SUP>
+</xsl:template>
+
+<!-- MIN and MAX (binari: estendere) -->
+
+ <xsl:template mode="inline" match="m:apply[m:min|m:max]">
+  <xsl:variable name="uri">
+   <xsl:value-of select="*[1]/@definitionURL"/>
+  </xsl:variable>
+  <xsl:variable name="symbol">
+   <xsl:choose>
+    <xsl:when test="m:min">
+     <xsl:value-of select="'min'"/>
+    </xsl:when>
+    <xsl:when test="m:max">
+     <xsl:value-of select="'max'"/>
+    </xsl:when>
+   </xsl:choose>
+  </xsl:variable>
+  <a>
+   <xsl:attribute name="href">
+    <xsl:value-of select="concat(string($header),string($uri))"/>
+   </xsl:attribute>
+   <xsl:value-of select="$symbol"/>
+  </a>
+  <xsl:text>{</xsl:text>
+  <xsl:apply-templates mode="inline" select="*[2]"/>
+  <xsl:text>, </xsl:text>
+  <xsl:apply-templates mode="inline" select="*[3]"/>
+  <xsl:text>}</xsl:text>
+</xsl:template>
+
+<!-- **************************************************************** -->
+<!--                   COUNTING MODE                                    -->
+<!-- **************************************************************** -->
+
+
 <xsl:template match="m:apply[m:limit]">
   <xsl:param name="current_indent" select="0"/> 
   <xsl:param name="width" select="$framewidth"/>
      </xsl:apply-templates>
     </xsl:when>
     <xsl:otherwise>
-     <a>
-     <xsl:attribute name="href">
-      <xsl:value-of select="concat(string($header),string($uri))"/>
-     </xsl:attribute>
-     <xsl:text>lim</xsl:text>
-     </a>
-     <SUB>
-      <xsl:apply-templates select="m:bvar/m:ci"/>
-      <FONT FACE="symbol" mathcolor="blue">&#174;</FONT>
-      <xsl:apply-templates select="m:lowlimit"/>
-     </SUB>
-     <xsl:apply-templates select="*[4]">
-      <xsl:with-param name="current_indent" select="$current_indent + 5"/>
-     </xsl:apply-templates>
+     <xsl:apply-templates mode="inline" select="."/>
     </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
 
 <!-- DIFFERENTIATION -->
-
 <xsl:template match="m:apply[m:diff]">
   <xsl:param name="current_indent" select="0"/> 
   <xsl:param name="width" select="$framewidth"/>
      </xsl:apply-templates>
  </xsl:template>
 
+
 <!-- ABSOLUTE VALUE -->
 <xsl:template match="m:apply[m:abs]">
   <xsl:param name="current_indent" select="0"/> 
      <xsl:text>}</xsl:text>
     </xsl:when>
     <xsl:otherwise>
-     <a>
-     <xsl:attribute name="href">
-      <xsl:value-of select="concat(string($header),string($uri))"/>
-     </xsl:attribute>
-     <xsl:value-of select="$symbol"/>
-     </a>
-     <xsl:text>{</xsl:text>
-     <xsl:apply-templates select="*[2]"/>
-     <xsl:text>, </xsl:text>
-     <xsl:apply-templates select="*[3]"/>
-     <xsl:text>}</xsl:text>
+     <xsl:apply-templates mode="inline" select="."/>
     </xsl:otherwise>
    </xsl:choose>
  </xsl:template>