]> matita.cs.unibo.it Git - helm.git/commitdiff
----------------------------------------------------------------------
authorIrene Schena <irene.schena@unibo.it>
Thu, 26 Jul 2001 11:52:34 +0000 (11:52 +0000)
committerIrene Schena <irene.schena@unibo.it>
Thu, 26 Jul 2001 11:52:34 +0000 (11:52 +0000)
Modified Files:
1) content_to_html.xsl html_init.xsl html_reals.xsl html_set.xsl: added
control on the existence of definitionURL
----------------------------------------------------------------------

helm/style/content_to_html.xsl
helm/style/html_init.xsl
helm/style/html_reals.xsl
helm/style/html_set.xsl

index fdf9b7829e3a5970d623ea95ca4f12ed23476849..1211e4881be96e555eba8e9d9245832cff02fdb8 100644 (file)
    <xsl:variable name="name">
     <xsl:value-of select="m:csymbol"/>
    </xsl:variable>
+   <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
    <xsl:choose>
     <!-- FORALL -->
     <xsl:when test="$name='forall'">
        <xsl:apply-templates select="*[3]" mode="inline"/>
        <xsl:text>[</xsl:text>
        <xsl:apply-templates select="*[4]" mode="inline"/>
-       <a href="{*[1]/@definitionURL}">
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="$name"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-       </a>
+       <xsl:choose>
+       <xsl:when test="$uri != ''">
+        <a href="{$uri}">
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+        </a>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+       </xsl:otherwise>
+       </xsl:choose>
        <xsl:apply-templates select="*[2]" mode="inline"/>
        <xsl:text>]</xsl:text>
       </xsl:when>
        <SUB>
        <xsl:apply-templates select="*[3]" mode="inline"/>
        </SUB>
-       <a href="{*[1]/@definitionURL}">
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="$name"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-       </a>
+       <xsl:choose>
+       <xsl:when test="$uri != ''">
+         <a href="{$uri}">
+          <xsl:call-template name="mksymbol-1">
+           <xsl:with-param name="symbol" select="$name"/>
+           <xsl:with-param name="color" select="'green'"/>
+           <xsl:with-param name="size" select="'+0'"/>
+          </xsl:call-template>
+         </a>
+       </xsl:when>
+       <xsl:otherwise>
+          <xsl:call-template name="mksymbol-1">
+           <xsl:with-param name="symbol" select="$name"/>
+           <xsl:with-param name="color" select="'green'"/>
+           <xsl:with-param name="size" select="'+0'"/>
+          </xsl:call-template>
+       </xsl:otherwise>
+       </xsl:choose>
        <SUP>
        <xsl:apply-templates select="*[4]" mode="inline"/>
        </SUP>
       </xsl:when>
 
       <xsl:when test="$name='lift'">
-       <a href="{*[1]/@definitionURL}">
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="$name"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-       </a>
+       <xsl:choose>
+       <xsl:when test="$uri != ''">
+        <a href="{$uri}">
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+        </a>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+       </xsl:otherwise>
+       </xsl:choose>
        <SUP>
        <xsl:apply-templates select="*[2]" mode="inline"/>
        </SUP>
       <!-- reduction --> 
       <xsl:when test="$name='beta_red1'">
        <xsl:apply-templates select="*[2]" mode="inline"/>
-       <a href="{*[1]/@definitionURL}">
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="$name"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-       <SUB>
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="'beta'"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-       </SUB>
-       </a>
+       <xsl:choose>
+       <xsl:when test="$uri != ''">
+        <a href="{$uri}">
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <SUB>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="'beta'"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         </SUB>
+        </a>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <SUB>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="'beta'"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         </SUB>
+       </xsl:otherwise>
+       </xsl:choose>
        <xsl:apply-templates select="*[3]" mode="inline"/>
       </xsl:when>
 
       <xsl:when test="$name='beta_red'">
        <xsl:apply-templates select="*[2]" mode="inline"/>
-       <a href="{*[1]/@definitionURL}">
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="$name"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-       <SUB>
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="'beta'"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-        <xsl:text>*</xsl:text>
-       </SUB>
-       </a>
+       <xsl:choose>
+       <xsl:when test="$uri != ''"> 
+        <a href="{$uri}">
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <SUB>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="'beta'"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <xsl:text>*</xsl:text>
+         </SUB>
+        </a>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <SUB>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="'beta'"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <xsl:text>*</xsl:text>
+         </SUB>
+       </xsl:otherwise>
+       </xsl:choose>
        <xsl:apply-templates select="*[3]" mode="inline"/>
       </xsl:when>
 
       <xsl:when test="$name='par_beta_red1'">
        <xsl:apply-templates select="*[2]" mode="inline"/>
-       <a href="{*[1]/@definitionURL}">
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="$name"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-       <SUB>
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="'beta'"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-       </SUB>
-       </a>
+       <xsl:choose>
+       <xsl:when test="$uri != ''">
+        <a href="{$uri}">
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <SUB>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="'beta'"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         </SUB>
+        </a>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <SUB>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="'beta'"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         </SUB>
+       </xsl:otherwise>
+       </xsl:choose>
        <xsl:apply-templates select="*[3]" mode="inline"/>
       </xsl:when>
 
       <xsl:when test="$name='par_beta_red'">
        <xsl:apply-templates select="*[2]" mode="inline"/>
-       <a href="{*[1]/@definitionURL}">
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="$name"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-       <SUB>
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="'beta'"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-        <xsl:text>*</xsl:text>
-       </SUB>
-       </a>
+       <xsl:choose>
+       <xsl:when test="$uri != ''">
+        <a href="{$uri}">
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <SUB>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="'beta'"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <xsl:text>*</xsl:text>
+         </SUB>
+        </a>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <SUB>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="'beta'"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <xsl:text>*</xsl:text>
+         </SUB>
+       </xsl:otherwise>
+       </xsl:choose>
        <xsl:apply-templates select="*[3]" mode="inline"/>
       </xsl:when>
 
       <!-- forgetful -->
       <xsl:when test="$name='forgetful'">
-       <a href="{*[1]/@definitionURL}">|</a>
+       <xsl:choose>
+       <xsl:when test="$uri != ''">
+        <a href="{$uri}">|</a>
+       </xsl:when>
+       <xsl:otherwise>
+        |
+       </xsl:otherwise>
+       </xsl:choose>
        <xsl:apply-templates select="*[2]" mode="inline"/>
-       <a href="{*[1]/@definitionURL}">|</a>
+        <xsl:choose>
+        <xsl:when test="$uri != ''">
+         <a href="{$uri}">|</a>
+        </xsl:when>
+       <xsl:otherwise>
+        |
+       </xsl:otherwise>
+       </xsl:choose>
       </xsl:when>
  
       <!-- boolean algebra of redexes -->
       <!-- isomorphic -->
       <xsl:when test="$name='isomorphic'">
        <xsl:apply-templates select="*[2]" mode="inline"/>
-       <a href="{*[1]/@definitionURL}">
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="$name"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-       </a>
+       <xsl:choose>
+       <xsl:when test="$uri != ''">
+        <a href="{$uri}">
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+        </a>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+       </xsl:otherwise>
+       </xsl:choose>
        <xsl:apply-templates select="*[3]" mode="inline"/>
       </xsl:when>
 
   </xsl:variable>
      <!-- <xsl:value-of select="$current_indent"/> -->
      <!-- <xsl:value-of select="$charlength"/> -->
+  <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
      <xsl:choose>
      <!-- FORALL -->
       <xsl:when test="$name='forall'">
        <xsl:apply-templates select="*[3]"/>
        <xsl:text>[</xsl:text>
        <xsl:apply-templates select="*[4]"/>
-       <a href="{*[1]/@definitionURL}">
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="$name"/>
-         <xsl:with-param name="color" select="'blue'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-       </a>
+       <xsl:choose>
+       <xsl:when test="$uri != ''">
+        <a href="{$uri}">
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'blue'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+        </a>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'blue'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+       </xsl:otherwise>
+       </xsl:choose>
        <xsl:apply-templates select="*[2]"/>
        <xsl:text>]</xsl:text>
       </xsl:when>
        <SUB>
        <xsl:apply-templates select="*[3]" mode="inline"/>
        </SUB>
-       <a href="{*[1]/@definitionURL}">
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="$name"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-       </a>
+       <xsl:choose>
+       <xsl:when test="$uri != ''">
+        <a href="{$uri}">
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+        </a>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+       </xsl:otherwise>
+       </xsl:choose>
        <SUP>
        <xsl:apply-templates select="*[4]" mode="inline"/>
        </SUP>
       </xsl:when>
 
       <xsl:when test="$name='lift'">
-       <a href="{*[1]/@definitionURL}">
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="$name"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-       </a>
+       <xsl:choose>
+       <xsl:when test="$uri != ''">
+        <a href="{$uri}">
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+        </a>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+       </xsl:otherwise>
+       </xsl:choose>
        <SUP>
        <xsl:apply-templates select="*[2]" mode="inline"/>
        </SUP>
       <!-- reduction --> 
       <xsl:when test="$name='beta_red1'">
        <xsl:apply-templates select="*[2]" mode="inline"/>
-       <a href="{*[1]/@definitionURL}">
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="$name"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-       <SUB>
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="'beta'"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-       </SUB>
-       </a>
+       <xsl:choose>
+       <xsl:when test="$uri != ''">
+        <a href="{$uri}">
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <SUB>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="'beta'"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         </SUB>
+        </a>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <SUB>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="'beta'"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         </SUB>
+       </xsl:otherwise>
+       </xsl:choose>
        <xsl:apply-templates select="*[3]" mode="inline"/>
       </xsl:when>
  
       <xsl:when test="$name='beta_red'">
        <xsl:apply-templates select="*[2]" mode="inline"/>
-       <a href="{*[1]/@definitionURL}">
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="$name"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-       <SUB>
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="'beta'"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-        <xsl:text>*</xsl:text>
-       </SUB>
-       </a>
+       <xsl:choose>
+       <xsl:when test="$uri != ''">
+        <a href="{$uri}">
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <SUB>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="'beta'"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <xsl:text>*</xsl:text>
+         </SUB>
+        </a>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <SUB>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="'beta'"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <xsl:text>*</xsl:text>
+         </SUB>
+       </xsl:otherwise>
+       </xsl:choose>
        <xsl:apply-templates select="*[3]" mode="inline"/>
       </xsl:when>
 
       <xsl:when test="$name='par_beta_red1'">
        <xsl:apply-templates select="*[2]" mode="inline"/>
-       <a href="{*[1]/@definitionURL}">
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="$name"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-       <SUB>
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="'beta'"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-       </SUB>
-       </a>
+       <xsl:choose>
+       <xsl:when test="$uri != ''">
+        <a href="{$uri}">
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <SUB>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="'beta'"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         </SUB>
+        </a>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <SUB>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="'beta'"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         </SUB>
+       </xsl:otherwise>
+       </xsl:choose>
        <xsl:apply-templates select="*[3]" mode="inline"/>
       </xsl:when>
 
       <xsl:when test="$name='par_beta_red'">
        <xsl:apply-templates select="*[2]" mode="inline"/>
-       <a href="{*[1]/@definitionURL}">
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="$name"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-       <SUB>
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="'beta'"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-        <xsl:text>*</xsl:text>
-       </SUB>
-       </a>
+       <xsl:choose>
+       <xsl:when test="$uri != ''">
+        <a href="{$uri}">
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <SUB>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="'beta'"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <xsl:text>*</xsl:text>
+         </SUB>
+        </a>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <SUB>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="'beta'"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+         <xsl:text>*</xsl:text>
+         </SUB>
+       </xsl:otherwise>
+       </xsl:choose>
        <xsl:apply-templates select="*[3]" mode="inline"/>
       </xsl:when>
 
       <!-- forgetful -->
       <xsl:when test="$name='forgetful'">
-       <a href="{*[1]/@definitionURL}">|</a>
+       <xsl:choose>
+       <xsl:when test="$uri != ''">
+        <a href="{$uri}">|</a>
+       </xsl:when>
+       <xsl:otherwise>
+        |
+       </xsl:otherwise>
+       </xsl:choose>
        <xsl:apply-templates select="*[2]" mode="inline"/>
-       <a href="{*[1]/@definitionURL}">|</a>
+       <xsl:choose>
+       <xsl:when test="$uri != ''">
+        <a href="{$uri}">|</a>
+       </xsl:when>
+       <xsl:otherwise>
+        |
+       </xsl:otherwise>
+       </xsl:choose>
       </xsl:when>
  
       <!-- boolean algebra of redexes -->
       <!-- isomorphic -->
       <xsl:when test="$name='isomorphic'">
        <xsl:apply-templates select="*[2]" mode="inline"/>
-       <a href="{*[1]/@definitionURL}">
-        <xsl:call-template name="mksymbol-1">
-         <xsl:with-param name="symbol" select="$name"/>
-         <xsl:with-param name="color" select="'green'"/>
-         <xsl:with-param name="size" select="'+0'"/>
-        </xsl:call-template>
-       </a>
+       <xsl:choose>
+       <xsl:when test="$uri != ''">
+        <a href="{$uri}">
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+        </a>
+       </xsl:when>
+       <xsl:otherwise>
+         <xsl:call-template name="mksymbol-1">
+          <xsl:with-param name="symbol" select="$name"/>
+          <xsl:with-param name="color" select="'green'"/>
+          <xsl:with-param name="size" select="'+0'"/>
+         </xsl:call-template>
+       </xsl:otherwise>
+       </xsl:choose>
        <xsl:apply-templates select="*[3]" mode="inline"/>
       </xsl:when>
 
index a6a840a576532ddfcf19db85a341e13087c4908d..06e23deca32262733225d7b0e43a0338e9de37a8 100644 (file)
 
  <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="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
   <xsl:text>(</xsl:text>
   <xsl:apply-templates mode="inline" select="*[2]"/>
-  <a href="{$uri}">
+  <xsl:choose>
+  <xsl:when test="$uri != ''">
+   <a href="{$uri}">
+    <xsl:call-template name="mksymbol-init">
+     <xsl:with-param name="symbol" select="local-name(*[1])"/>
+    </xsl:call-template>
+   </a>
+  </xsl:when>
+  <xsl:otherwise>
    <xsl:call-template name="mksymbol-init">
-    <xsl:with-param name="symbol" select="local-name(*[1])"/>
+     <xsl:with-param name="symbol" select="local-name(*[1])"/>
    </xsl:call-template>
-  </a>
+  </xsl:otherwise>
+  </xsl:choose>
   <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:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
   <xsl:choose>
    <xsl:when test="count(child::*)=2">
-    <a href="{$uri}">
+    <xsl:choose>
+    <xsl:when test="$uri != ''">
+     <a href="{$uri}">
+      <xsl:call-template name="mksymbol-init">
+       <xsl:with-param name="symbol" select="'minus'"/>
+      </xsl:call-template>
+     </a>
+    </xsl:when>
+    <xsl:otherwise>
      <xsl:call-template name="mksymbol-init">
-      <xsl:with-param name="symbol" select="'minus'"/>
+       <xsl:with-param name="symbol" select="'minus'"/>
      </xsl:call-template>
-    </a>
+    </xsl:otherwise>
+    </xsl:choose>
     <xsl:apply-templates mode="inline" select="*[2]"/>
    </xsl:when>
    <xsl:otherwise>
     <xsl:text>(</xsl:text>
     <xsl:apply-templates mode="inline" select="*[2]"/>
-    <a href="{$uri}">
+    <xsl:choose>
+    <xsl:when test="$uri != ''">
+     <a href="{$uri}">
+      <xsl:call-template name="mksymbol-init">
+       <xsl:with-param name="symbol" select="'minus'"/>
+      </xsl:call-template>
+     </a>
+    </xsl:when>
+    <xsl:otherwise>
      <xsl:call-template name="mksymbol-init">
-      <xsl:with-param name="symbol" select="'minus'"/>
+       <xsl:with-param name="symbol" select="'minus'"/>
      </xsl:call-template>
-    </a>
+    </xsl:otherwise>
+    </xsl:choose>
     <xsl:apply-templates mode="inline" select="*[3]"/>
     <xsl:text>)</xsl:text>
    </xsl:otherwise>
 
 <!-- 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 href="{$uri}">
-      <xsl:call-template name="mksymbol-init">
-       <xsl:with-param name="symbol" select="'not'"/>
-      </xsl:call-template>
-     </a>
-     <xsl:apply-templates mode="inline" select="*[2]"/>
- </xsl:template>
+<xsl:template mode="inline" match="m:apply[m:not]">
+  <xsl:variable name="uri"><xsl:value-of select="m:not/@definitionURL"/></xsl:variable>
+  <xsl:choose>
+  <xsl:when test="$uri != ''">
+   <a href="{$uri}">
+    <xsl:call-template name="mksymbol-init">
+     <xsl:with-param name="symbol" select="'not'"/>
+    </xsl:call-template>
+   </a>
+  </xsl:when>
+  <xsl:otherwise>
+   <xsl:call-template name="mksymbol-init">
+    <xsl:with-param name="symbol" select="'not'"/>
+   </xsl:call-template>
+  </xsl:otherwise>
+  </xsl:choose>
+  <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 href="{$uri}">
+  <xsl:variable name="uri"><xsl:value-of select="m:exists/@definitionURL"/></xsl:variable>
+  <xsl:choose>
+  <xsl:when test="$uri != ''">
+   <a href="{$uri}">
+    <xsl:call-template name="mksymbol-init">
+     <xsl:with-param name="symbol" select="'exists'"/>
+    </xsl:call-template>
+   </a>
+  </xsl:when>
+  <xsl:otherwise>
    <xsl:call-template name="mksymbol-init">
     <xsl:with-param name="symbol" select="'exists'"/>
    </xsl:call-template>
-  </a>
+  </xsl:otherwise>
+  </xsl:choose>
   <xsl:apply-templates select="m:bvar/m:ci"/>
   <xsl:text>:</xsl:text>
   <xsl:apply-templates mode="inline" select="m:condition"/>
        |m:geq|m:gt|m:plus|m:times]">
   <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:call-template name="make_indent">
       <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
      </xsl:call-template>
-     <a href="{$uri}">
-      <xsl:call-template name="mksymbol-init">
-       <xsl:with-param name="symbol" select="local-name(*[1])"/>
-      </xsl:call-template>
-     </a>
+     <xsl:choose>
+     <xsl:when test="$uri != ''">
+      <a href="{$uri}">
+       <xsl:call-template name="mksymbol-init">
+        <xsl:with-param name="symbol" select="local-name(*[1])"/>
+       </xsl:call-template>
+      </a>
+     </xsl:when>
+     <xsl:otherwise>
+       <xsl:call-template name="mksymbol-init">
+        <xsl:with-param name="symbol" select="local-name(*[1])"/>
+       </xsl:call-template>
+     </xsl:otherwise>
+     </xsl:choose>
      <xsl:apply-templates select="*[3]">
       <xsl:with-param name="current_indent" select="$current_indent + 2"/>
      </xsl:apply-templates>
 <xsl:template match="m:apply[m:minus]">
   <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:choose>
    <xsl:when test="count(child::*)=2">
-    <a href="{$uri}">
-     <xsl:call-template name="mksymbol-init">
-      <xsl:with-param name="symbol" select="'minus'"/>
-     </xsl:call-template>
-    </a>
+    <xsl:choose>
+    <xsl:when test="$uri != ''">
+     <a href="{$uri}">
+      <xsl:call-template name="mksymbol-init">
+       <xsl:with-param name="symbol" select="'minus'"/>
+      </xsl:call-template>
+     </a>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:call-template name="mksymbol-init">
+       <xsl:with-param name="symbol" select="'minus'"/>
+      </xsl:call-template>
+    </xsl:otherwise>
+    </xsl:choose>
     <xsl:apply-templates select="*[2]">
      <xsl:with-param name="current_indent" select="$current_indent + 1"/>
     </xsl:apply-templates>
       <xsl:call-template name="make_indent">
        <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
       </xsl:call-template>
-      <a href="{$uri}">
-       <xsl:call-template name="mksymbol-init">
-        <xsl:with-param name="symbol" select="'minus'"/>
-       </xsl:call-template>
-      </a>
+      <xsl:choose>
+      <xsl:when test="$uri != ''">
+       <a href="{$uri}">
+        <xsl:call-template name="mksymbol-init">
+         <xsl:with-param name="symbol" select="'minus'"/>
+        </xsl:call-template>
+       </a>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="mksymbol-init">
+         <xsl:with-param name="symbol" select="'minus'"/>
+        </xsl:call-template>
+      </xsl:otherwise>
+      </xsl:choose>  
       <xsl:apply-templates select="*[3]">
        <xsl:with-param name="current_indent" select="$current_indent + 2"/>
       </xsl:apply-templates>
 
 <!-- NOT -->
 
- <xsl:template match="m:apply[m:not]">
+<xsl:template match="m:apply[m:not]">
   <xsl:param name="current_indent" select="0"/> 
   <xsl:param name="width" select="$framewidth"/>
-  <xsl:variable name="uri">
-   <xsl:value-of select="m:not/@definitionURL"/>
-  </xsl:variable>
-     <a href="{$uri}">
-      <xsl:call-template name="mksymbol-init">
-       <xsl:with-param name="symbol" select="'not'"/>
-      </xsl:call-template>
-     </a>
-     <xsl:apply-templates select="*[2]"/>
+  <xsl:variable name="uri"><xsl:value-of select="m:not/@definitionURL"/></xsl:variable>
+   <xsl:choose>
+   <xsl:when test="$uri != ''">
+    <a href="{$uri}">
+     <xsl:call-template name="mksymbol-init">
+      <xsl:with-param name="symbol" select="'not'"/>
+     </xsl:call-template>
+    </a>
+   </xsl:when>
+   <xsl:otherwise>
+     <xsl:call-template name="mksymbol-init">
+      <xsl:with-param name="symbol" select="'not'"/>
+     </xsl:call-template>
+   </xsl:otherwise>
+   </xsl:choose>
+   <xsl:apply-templates select="*[2]"/>
  </xsl:template>
 
 <!-- EXISTS -->
  <xsl:template match="m:apply[m:exists]">
   <xsl:param name="current_indent" select="0"/> 
   <xsl:param name="width" select="$framewidth"/>
-  <xsl:variable name="uri">
-   <xsl:value-of select="m:exists/@definitionURL"/>
-  </xsl:variable>
+  <xsl:variable name="uri"><xsl:value-of select="m:exists/@definitionURL"/></xsl:variable>
   <xsl:variable name="charlength">
    <xsl:apply-templates select="m:exists" mode="charcount"/>
   </xsl:variable>
   <xsl:choose>
     <xsl:when test="$charlength > $framewidth">
-     <a href="{$uri}">
-      <xsl:call-template name="mksymbol-init">
-       <xsl:with-param name="symbol" select="'exists'"/>
-      </xsl:call-template>
-     </a>
+     <xsl:choose>
+     <xsl:when test="$uri != ''">
+      <a href="{$uri}">
+       <xsl:call-template name="mksymbol-init">
+        <xsl:with-param name="symbol" select="'exists'"/>
+       </xsl:call-template>
+      </a>
+     </xsl:when>
+     <xsl:otherwise>
+       <xsl:call-template name="mksymbol-init">
+        <xsl:with-param name="symbol" select="'exists'"/>
+       </xsl:call-template>
+     </xsl:otherwise>
+     </xsl:choose>
      <xsl:apply-templates select="m:bvar/m:ci"/>
      <xsl:text>:</xsl:text>
      <xsl:apply-templates select="m:condition">
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"/>
index e8f82e7b223ab47f10e6c87af2ef7fb756681400..900329f795c394025548cb8e03f6ac2134e450a9 100644 (file)
 
 <xsl:template mode="inline" match="m:apply[m:in|m:notin|m:intersect|m:union
   |m:subset|m:prsubset|m:setdiff]">
-  <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:in">
   </xsl:variable>
   <xsl:text>(</xsl:text>
   <xsl:apply-templates mode="inline" select="*[2]"/>
-  <a href="{$uri}">
-   <xsl:call-template name="mksymbol">
-    <xsl:with-param name="symbol">
-     <xsl:value-of select="local-name(*[1])"/>
-    </xsl:with-param>
-   </xsl:call-template>
-  </a>
+  <xsl:choose>
+  <xsl:when test="$uri != ''">
+   <a href="{$uri}">
+    <xsl:call-template name="mksymbol">
+     <xsl:with-param name="symbol">
+      <xsl:value-of select="local-name(*[1])"/>
+     </xsl:with-param>
+    </xsl:call-template>
+   </a>
+  </xsl:when>
+  <xsl:otherwise>
+    <xsl:call-template name="mksymbol">
+     <xsl:with-param name="symbol">
+      <xsl:value-of select="local-name(*[1])"/>
+     </xsl:with-param>
+    </xsl:call-template>
+  </xsl:otherwise>
+  </xsl:choose>
   <xsl:apply-templates mode="inline" select="*[3]"/>
   <xsl:text>)</xsl:text>
  </xsl:template>
   |m:subset|m:prsubset|m:setdiff]">
   <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:call-template name="make_indent">
       <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
      </xsl:call-template>
-     <a href="{$uri}">
-      <xsl:call-template name="mksymbol">
-       <xsl:with-param name="symbol">
-        <xsl:value-of select="local-name(*[1])"/>
-       </xsl:with-param>
-      </xsl:call-template>
-     </a>
+     <xsl:choose>
+     <xsl:when test="$uri != ''"> 
+      <a href="{$uri}">
+       <xsl:call-template name="mksymbol">
+        <xsl:with-param name="symbol">
+         <xsl:value-of select="local-name(*[1])"/>
+        </xsl:with-param>
+       </xsl:call-template>
+      </a>
+     </xsl:when>
+     <xsl:otherwise>
+       <xsl:call-template name="mksymbol">
+        <xsl:with-param name="symbol">
+         <xsl:value-of select="local-name(*[1])"/>
+        </xsl:with-param>
+       </xsl:call-template>
+     </xsl:otherwise>
+     </xsl:choose> 
      <xsl:apply-templates select="*[3]">
       <xsl:with-param name="current_indent" select="$current_indent + 2"/>
      </xsl:apply-templates>