]> matita.cs.unibo.it Git - helm.git/commitdiff
UNICODEvsSYMBOL introduced everywhere. (work completed)
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Tue, 26 Jun 2001 12:38:58 +0000 (12:38 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Tue, 26 Jun 2001 12:38:58 +0000 (12:38 +0000)
helm/style/html_init.xsl
helm/style/html_reals.xsl
helm/style/html_set.xsl

index f6fad1619797912f71d53d452aeb706b3cb218d5..93791685ce848fbd5780dcf0e7cf7aea8b6ae80d 100644 (file)
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                               xmlns:m="http://www.w3.org/1998/Math/MathML">
 
+<xsl:template name="mksymbol-init">
+ <xsl:param name="symbol" select="''"/>
+  <xsl:choose>
+   <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">
+    <xsl:variable name="fontsymbol">
+     <xsl:choose>
+      <xsl:when test="$symbol = 'and'">
+       <xsl:value-of select="'&#217;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'or'">
+       <xsl:value-of select="'&#218;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'eq'">
+       <xsl:value-of select="'&#61;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'neq'">
+       <xsl:value-of select="'&#185;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'leq'">
+       <xsl:value-of select="'&#163;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'lt'">
+       <xsl:value-of select="'&#60;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'geq'">
+       <xsl:value-of select="'&#179;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'gt'">
+       <xsl:value-of select="'&#62;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'plus'">
+       <xsl:value-of select="'&#43;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'times'">
+       <xsl:value-of select="'&#42;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'minus'">
+       <xsl:value-of select="'&#45;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'not'">
+       <xsl:value-of select="'&#216;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'exists'">
+       <xsl:value-of select="'&#36;'"/>
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:text>???</xsl:text>
+      </xsl:otherwise>
+     </xsl:choose>
+    </xsl:variable>
+    <FONT FACE="symbol" color="'blue'">
+     <xsl:value-of select="$fontsymbol"/>
+    </FONT>
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:variable name="unicodesymbol">
+     <xsl:choose>
+      <xsl:when test="$symbol = 'and'">
+       <xsl:value-of select="'&#8743;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'or'">
+       <xsl:value-of select="'&#8744;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'eq'">
+       <xsl:value-of select="'&#61;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'neq'">
+       <xsl:value-of select="'&#8800;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'leq'">
+       <xsl:value-of select="'&#8804;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'lt'">
+       <xsl:value-of select="'&#60;&#32;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'geq'">
+       <xsl:value-of select="'&#8805;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'gt'">
+       <xsl:value-of select="'&#62;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'plus'">
+       <xsl:value-of select="'&#43;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'times'">
+       <xsl:value-of select="'&#8727;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'minus'">
+       <xsl:value-of select="'&#8722;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'not'">
+       <xsl:value-of select="'&#172;'"/>
+      </xsl:when>
+      <xsl:when test="$symbol = 'exists'">
+       <xsl:value-of select="'&#8707;'"/>
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:text>???</xsl:text>
+      </xsl:otherwise>
+     </xsl:choose>
+    </xsl:variable>
+    <FONT color="'blue'">
+     <xsl:value-of select="$unicodesymbol"/>
+    </FONT>
+   </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+
 <!--***********************************************************************--> 
 <!-- INIT style for HTML                                                   -->
 <!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                      -->
   <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 href="{$uri}">
-   <FONT FACE="symbol" SIZE="+0" mathcolor="blue">
-    <xsl:value-of select="$symbol"/>
-   </FONT>
+   <xsl:call-template name="mksymbol-init">
+    <xsl:with-param name="symbol" select="local-name(*[1])"/>
+   </xsl:call-template>
   </a>
   <xsl:apply-templates mode="inline" select="*[3]"/>
   <xsl:text>)</xsl:text>
   <xsl:choose>
    <xsl:when test="count(child::*)=2">
     <a href="{$uri}">
-    <FONT FACE="symbol" SIZE="+0" mathcolor="blue">&#45;</FONT>
+     <xsl:call-template name="mksymbol-init">
+      <xsl:with-param name="symbol" select="'minus'"/>
+     </xsl:call-template>
     </a>
     <xsl:apply-templates mode="inline" select="*[2]"/>
    </xsl:when>
     <xsl:text>(</xsl:text>
     <xsl:apply-templates mode="inline" select="*[2]"/>
     <a href="{$uri}">
-     <FONT FACE="symbol" SIZE="+0" mathcolor="blue">&#45;</FONT>
+     <xsl:call-template name="mksymbol-init">
+      <xsl:with-param name="symbol" select="'minus'"/>
+     </xsl:call-template>
     </a>
     <xsl:apply-templates mode="inline" select="*[3]"/>
     <xsl:text>)</xsl:text>
    <xsl:value-of select="m:not/@definitionURL"/>
   </xsl:variable>
      <a href="{$uri}">
-     <FONT FACE="symbol" SIZE="+0" mathcolor="blue">&#216;</FONT>
+      <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:value-of select="m:exists/@definitionURL"/>
   </xsl:variable>
   <a href="{$uri}">
-   <FONT FACE="symbol" SIZE="+0" mathcolor="blue">&#36;</FONT>
+   <xsl:call-template name="mksymbol-init">
+    <xsl:with-param name="symbol" select="'exists'"/>
+   </xsl:call-template>
   </a>
   <xsl:apply-templates select="m:bvar/m:ci"/>
   <xsl:text>:</xsl:text>
   <xsl:variable name="charlength">
    <xsl:apply-templates select="*[1]" mode="charcount"/>
   </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:choose>
     <xsl:when test="$charlength > $framewidth">
      <xsl:text>(</xsl:text>
       <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
      </xsl:call-template>
      <a href="{$uri}">
-     <FONT FACE="symbol" SIZE="+0" mathcolor="blue">
-      <xsl:value-of select="$symbol"/>
-     </FONT>
+      <xsl:call-template name="mksymbol-init">
+       <xsl:with-param name="symbol" select="local-name(*[1])"/>
+      </xsl:call-template>
      </a>
      <xsl:apply-templates select="*[3]">
       <xsl:with-param name="current_indent" select="$current_indent + 2"/>
   <xsl:choose>
    <xsl:when test="count(child::*)=2">
     <a href="{$uri}">
-    <FONT FACE="symbol" SIZE="+0" mathcolor="blue">&#45;</FONT>
+     <xsl:call-template name="mksymbol-init">
+      <xsl:with-param name="symbol" select="'minus'"/>
+     </xsl:call-template>
     </a>
     <xsl:apply-templates select="*[2]">
      <xsl:with-param name="current_indent" select="$current_indent + 1"/>
        <xsl:with-param name="current_indent" select="$current_indent + 2"/> 
       </xsl:call-template>
       <a href="{$uri}">
-      <FONT FACE="symbol" SIZE="+0" mathcolor="blue">&#45;</FONT>
+       <xsl:call-template name="mksymbol-init">
+        <xsl:with-param name="symbol" select="'minus'"/>
+       </xsl:call-template>
       </a>
       <xsl:apply-templates select="*[3]">
        <xsl:with-param name="current_indent" select="$current_indent + 2"/>
    <xsl:value-of select="m:not/@definitionURL"/>
   </xsl:variable>
      <a href="{$uri}">
-     <FONT FACE="symbol" SIZE="+0" mathcolor="blue">&#216;</FONT>
+      <xsl:call-template name="mksymbol-init">
+       <xsl:with-param name="symbol" select="'not'"/>
+      </xsl:call-template>
      </a>
      <xsl:apply-templates select="*[2]"/>
  </xsl:template>
   <xsl:choose>
     <xsl:when test="$charlength > $framewidth">
      <a href="{$uri}">
-      <FONT FACE="symbol" SIZE="+0" mathcolor="blue">&#36;</FONT>
+      <xsl:call-template name="mksymbol-init">
+       <xsl:with-param name="symbol" select="'exists'"/>
+      </xsl:call-template>
      </a>
      <xsl:apply-templates select="m:bvar/m:ci"/>
      <xsl:text>:</xsl:text>
index 9d49b1305edfa2287b4d9fdacf1b7515b4e29573..32c81792704447a2eef7bdf3716ceb997696a206 100644 (file)
 <!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena                      -->
 <!--***********************************************************************--> 
 
+<xsl:template name="mksymbol-reals">
+ <xsl:param name="symbol" select="''"/>
+  <xsl:choose>
+   <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">
+    <xsl:variable name="fontsymbol">
+     <xsl:choose>
+      <xsl:when test="$symbol = 'leadsto'">
+       <xsl:value-of select="'&#174;'"/>
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:text>???</xsl:text>
+      </xsl:otherwise>
+     </xsl:choose>
+    </xsl:variable>
+    <FONT FACE="symbol" color="'blue'">
+     <xsl:value-of select="$fontsymbol"/>
+    </FONT>
+   </xsl:when>
+   <xsl:otherwise>
+    <xsl:variable name="unicodesymbol">
+     <xsl:choose>
+      <xsl:when test="$symbol = 'leadsto'">
+       <xsl:value-of select="'&#8594;'"/>
+      </xsl:when>
+      <xsl:otherwise>
+       <xsl:text>???</xsl:text>
+      </xsl:otherwise>
+     </xsl:choose>
+    </xsl:variable>
+    <FONT color="'blue'">
+     <xsl:value-of select="$unicodesymbol"/>
+    </FONT>
+   </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
 <!-- **************************************************************** -->
 <!--                   INLINE MODE                                    -->
 <!-- **************************************************************** -->
@@ -48,7 +84,9 @@
      </a>
      <SUB>
       <xsl:apply-templates select="m:bvar/m:ci"/>
-      <FONT FACE="symbol" mathcolor="blue">&#174;</FONT>
+      <xsl:call-template name="mksymbol-reals">
+       <xsl:with-param name="symbol" select="'leadsto'"/>
+      </xsl:call-template>
       <xsl:apply-templates mode="inline" select="m:lowlimit"/>
      </SUB>
      <xsl:apply-templates mode="inline" select="*[4]"/>
      </a>
      <SUB>
       <xsl:apply-templates select="m:bvar/m:ci"/>
-      <FONT FACE="symbol" mathcolor="blue">&#174;</FONT>
+      <xsl:call-template name="mksymbol-reals">
+       <xsl:with-param name="symbol" select="'leadsto'"/>
+      </xsl:call-template>
       <xsl:apply-templates select="m:lowlimit"/>
      </SUB>
      <BR/> 
index 73338c48f1d8c53a357680f40ace5392ccf73655..5c7052c033b2f5253951189609446d98d45ef1cd 100644 (file)
@@ -64,7 +64,7 @@
       </xsl:when>
      </xsl:choose>
     </xsl:variable>
-    <FONT FACE="symbol" SIZE="+0" mathcolor="blue">
+    <FONT FACE="symbol" mathcolor="blue">
      <xsl:value-of select="$fontsymbol"/>
     </FONT>
    </xsl:when>