]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/html_reals.xsl
----------------------------------------------------------------------
[helm.git] / helm / style / html_reals.xsl
index 32c81792704447a2eef7bdf3716ceb997696a206..15071579ab569b2d05eff9fbd1880d62be78fbaf 100644 (file)
 
 
 <xsl:template mode="inline" match="m:apply[m:limit]">
-     <xsl:variable name="uri">
-      <xsl:value-of select="m:limit/@definitionURL"/>
-     </xsl:variable>
-     <a href="{$uri}">
+     <xsl:variable name="uri"><xsl:value-of select="m:limit/@definitionURL"/></xsl:variable>
+     <xsl:choose>
+     <xsl:when test="$uri != ''">
+      <a href="{$uri}">
+       <xsl:text>lim</xsl:text>
+      </a>
+     </xsl:when>
+     <xsl:otherwise>
       <xsl:text>lim</xsl:text>
-     </a>
+     </xsl:otherwise>
+     </xsl:choose>
      <SUB>
       <xsl:apply-templates select="m:bvar/m:ci"/>
       <xsl:call-template name="mksymbol-reals">
 <!-- DIFFERENTIATION -->
 
 <xsl:template mode="inline" match="m:apply[m:diff]">
-     <xsl:variable name="uri">
-      <xsl:value-of select="m:diff/@definitionURL"/>
-     </xsl:variable>
-     <a href="{$uri}">
+     <xsl:variable name="uri"><xsl:value-of select="m:diff/@definitionURL"/></xsl:variable>
+     <xsl:choose>
+     <xsl:when test="$uri != ''">
+      <a href="{$uri}">
+       <SUP>d</SUP>
+       <xsl:text>/</xsl:text>
+       <SUB>
+        <xsl:text>d</xsl:text>
+        <xsl:value-of select="m:bvar/m:ci"/>
+       </SUB>
+      </a>
+     </xsl:when>
+     <xsl:otherwise>
       <SUP>d</SUP>
-      <xsl:text>/</xsl:text>
-      <SUB>
-       <xsl:text>d</xsl:text>
-       <xsl:value-of select="m:bvar/m:ci"/>
-      </SUB>
-     </a>
+       <xsl:text>/</xsl:text>
+       <SUB>
+        <xsl:text>d</xsl:text>
+        <xsl:value-of select="m:bvar/m:ci"/>
+       </SUB>
+     </xsl:otherwise>
+     </xsl:choose>
      <xsl:apply-templates mode="inline" select="*[3]"/>
  </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="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
   <xsl:variable name="symbol">
    <xsl:choose>
     <xsl:when test="m:min">
     </xsl:when>
    </xsl:choose>
   </xsl:variable>
-  <a href="{$uri}">
+  <xsl:choose>
+  <xsl:when test="$uri != ''">
+   <a href="{$uri}">
+    <xsl:value-of select="$symbol"/>
+   </a>
+  </xsl:when>
+  <xsl:otherwise>
    <xsl:value-of select="$symbol"/>
-  </a>
+  </xsl:otherwise>
+  </xsl:choose>
   <xsl:text>{</xsl:text>
   <xsl:apply-templates mode="inline" select="*[2]"/>
   <xsl:text>, </xsl:text>
 <xsl:template match="m:apply[m:limit]">
   <xsl:param name="current_indent" select="0"/> 
   <xsl:param name="width" select="$framewidth"/>
-  <xsl:variable name="uri">
-   <xsl:value-of select="m:limit/@definitionURL"/>
-  </xsl:variable>
+  <xsl:variable name="uri"><xsl:value-of select="m:limit/@definitionURL"/></xsl:variable>
   <xsl:variable name="charlength">
    <xsl:apply-templates select="m:limit" mode="charcount"/>
   </xsl:variable>
   <xsl:choose>
     <xsl:when test="$charlength > $framewidth">
-     <a href="{$uri}">
+     <xsl:choose>
+     <xsl:when test="$uri != ''">
+      <a href="{$uri}">
+       <xsl:text>lim</xsl:text>
+      </a>
+     </xsl:when>
+     <xsl:otherwise>
       <xsl:text>lim</xsl:text>
-     </a>
+     </xsl:otherwise>
+     </xsl:choose>
      <SUB>
       <xsl:apply-templates select="m:bvar/m:ci"/>
       <xsl:call-template name="mksymbol-reals">
 <xsl:template match="m:apply[m:diff]">
   <xsl:param name="current_indent" select="0"/> 
   <xsl:param name="width" select="$framewidth"/>
-  <xsl:variable name="uri">
-   <xsl:value-of select="m:diff/@definitionURL"/>
-  </xsl:variable>
-     <a href="{$uri}">
-      <SUP>d</SUP>
-      <xsl:text>/</xsl:text>
-      <SUB>
-       <xsl:text>d</xsl:text>
-       <xsl:value-of select="m:bvar/m:ci"/>
-      </SUB>
-     </a>
+  <xsl:variable name="uri"><xsl:value-of select="m:diff/@definitionURL"/></xsl:variable>
+     <xsl:choose>
+     <xsl:when test="$uri != ''">
+      <a href="{$uri}">
+       <SUP>d</SUP>
+       <xsl:text>/</xsl:text>
+       <SUB>
+        <xsl:text>d</xsl:text>
+        <xsl:value-of select="m:bvar/m:ci"/>
+       </SUB>
+      </a>
+     </xsl:when>
+     <xsl:otherwise>
+       <SUP>d</SUP>
+       <xsl:text>/</xsl:text>
+       <SUB>
+        <xsl:text>d</xsl:text>
+        <xsl:value-of select="m:bvar/m:ci"/>
+       </SUB>
+     </xsl:otherwise>
+     </xsl:choose>
      <xsl:apply-templates select="*[3]">
       <xsl:with-param name="current_indent" select="$current_indent + 5"/>
      </xsl:apply-templates>
  <xsl:template match="m:apply[m:min|m:max]">
   <xsl:param name="current_indent" select="0"/> 
   <xsl:param name="width" select="$framewidth"/>
-  <xsl:variable name="uri">
-   <xsl:value-of select="*[1]/@definitionURL"/>
-  </xsl:variable>
+  <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
   <xsl:variable name="charlength">
    <xsl:apply-templates select="*[1]" mode="charcount"/>
   </xsl:variable>
   </xsl:variable>
   <xsl:choose>
     <xsl:when test="$charlength > $framewidth">
-     <a href="{$uri}">
+     <xsl:choose>
+     <xsl:when test="$uri != ''">
+      <a href="{$uri}">
+       <xsl:value-of select="$symbol"/>
+      </a>
+     </xsl:when>
+     <xsl:otherwise>
       <xsl:value-of select="$symbol"/>
-     </a>
+     </xsl:otherwise>
+     </xsl:choose>
      <xsl:text>{</xsl:text>
      <xsl:apply-templates select="*[2]">
       <xsl:with-param name="current_indent" select="$current_indent + 2"/>