]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/style/html_reals.xsl
This commit was manufactured by cvs2svn to create branch 'init'.
[helm.git] / helm / style / html_reals.xsl
diff --git a/helm/style/html_reals.xsl b/helm/style/html_reals.xsl
deleted file mode 100644 (file)
index a78f454..0000000
+++ /dev/null
@@ -1,469 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- Copyright (C) 2000, HELM Team                                     -->
-<!--                                                                   -->
-<!-- This file is part of HELM, an Hypertextual, Electronic            -->
-<!-- Library of Mathematics, developed at the Computer Science         -->
-<!-- Department, University of Bologna, Italy.                         -->
-<!--                                                                   -->
-<!-- HELM is free software; you can redistribute it and/or             -->
-<!-- modify it under the terms of the GNU General Public License       -->
-<!-- as published by the Free Software Foundation; either version 2    -->
-<!-- of the License, or (at your option) any later version.            -->
-<!--                                                                   -->
-<!-- HELM is distributed in the hope that it will be useful,           -->
-<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of    -->
-<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     -->
-<!-- GNU General Public License for more details.                      -->
-<!--                                                                   -->
-<!-- You should have received a copy of the GNU General Public License -->
-<!-- along with HELM; if not, write to the Free Software               -->
-<!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston,            -->
-<!-- MA  02111-1307, USA.                                              -->
-<!--                                                                   -->
-<!-- For details, see the HELM World-Wide-Web page,                    -->
-<!-- http://cs.unibo.it/helm/.                                         -->
-
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-                              xmlns:m="http://www.w3.org/1998/Math/MathML">
-
-<!--***********************************************************************--> 
-<!-- INIT style for HTML                                                   -->
-<!-- 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:when test="$symbol = 'sum'">
-       <xsl:value-of select="'&#229;'"/>
-      </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:when test="$symbol = 'sum'">
-       <xsl:value-of select="'&#x02211;'"/>
-      </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                                    -->
-<!-- **************************************************************** -->
-
-<!-- SUM -->
-
-<xsl:template mode="inline" match="m:apply[m:sum]">
-     <xsl:variable name="uri">
-      <xsl:value-of select="m:sum/@definitionURL"/>
-     </xsl:variable>
-     <xsl:choose>
-      <xsl:when test="$uri != ''">
-       <a href="{$uri}">
-       <!-- 
-       <FONT FACE="symbol" color="'blue'">
-        <xsl:value-of select="'&#229;'"/>
-       </FONT> -->
-       <xsl:call-template name="mksymbol-reals">
-        <xsl:with-param name="symbol" select="'sum'"/>
-      </xsl:call-template>
-       </a>
-      </xsl:when>
-      <xsl:otherwise>
-       <!-- 
-       <FONT FACE="symbol" color="'blue'">
-        <xsl:value-of select="'&#229;'"/>
-       </FONT> -->
-       <xsl:call-template name="mksymbol-reals">
-        <xsl:with-param name="symbol" select="'sum'"/>
-       </xsl:call-template>
-      </xsl:otherwise>
-     </xsl:choose>
-     <xsl:choose>
-      <xsl:when test="m:condition">
-       <SUB>
-        <xsl:apply-templates select="m:condition"/>
-       </SUB>
-      </xsl:when>
-      <xsl:otherwise>
-       <SUB>
-        <xsl:apply-templates select="m:lowlimit/*[1]"/>
-        <xsl:call-template name="mksymbol-init">
-         <xsl:with-param name="symbol" select="'leq'"/>
-        </xsl:call-template>
-        <xsl:apply-templates select="m:bvar/*[1]"/>
-        <xsl:call-template name="mksymbol-init">
-         <xsl:with-param name="symbol" select="'leq'"/>
-        </xsl:call-template>
-        <xsl:apply-templates select="m:uplimit/*[1]"/>
-       </SUB>
-      </xsl:otherwise>
-     </xsl:choose>
-     <xsl:apply-templates mode="inline" select="*[position()=last()]"/>
- </xsl:template>
-
-
-<!-- LIMIT -->
-
-
-<xsl:template mode="inline" match="m:apply[m:limit]">
-     <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>
-     </xsl:otherwise>
-     </xsl:choose>
-     <SUB>
-      <xsl:apply-templates select="m:bvar/m:ci"/>
-      <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]"/>
- </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>
-     <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 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>
-  <xsl:choose>
-  <xsl:when test="$uri != ''">
-   <a href="{$uri}">
-    <xsl:value-of select="$symbol"/>
-   </a>
-  </xsl:when>
-  <xsl:otherwise>
-   <xsl:value-of select="$symbol"/>
-  </xsl:otherwise>
-  </xsl:choose>
-  <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:sum]">
- <xsl:apply-templates mode="inline" select="."/>
-</xsl:template>
-
-<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="charlength">
-   <xsl:apply-templates select="m:limit" mode="charcount"/>
-  </xsl:variable>
-  <xsl:choose>
-    <xsl:when test="$charlength > $framewidth">
-     <xsl:choose>
-     <xsl:when test="$uri != ''">
-      <a href="{$uri}">
-       <xsl:text>lim</xsl:text>
-      </a>
-     </xsl:when>
-     <xsl:otherwise>
-      <xsl:text>lim</xsl:text>
-     </xsl:otherwise>
-     </xsl:choose>
-     <SUB>
-      <xsl:apply-templates select="m:bvar/m:ci"/>
-      <xsl:call-template name="mksymbol-reals">
-       <xsl:with-param name="symbol" select="'leadsto'"/>
-      </xsl:call-template>
-      <xsl:apply-templates select="m:lowlimit"/>
-     </SUB>
-     <BR/> 
-     <xsl:call-template name="make_indent">
-      <xsl:with-param name="current_indent" select="$current_indent + 5"/> 
-     </xsl:call-template>
-     <xsl:apply-templates select="*[4]">
-      <xsl:with-param name="current_indent" select="$current_indent + 5"/>
-     </xsl:apply-templates>
-    </xsl:when>
-    <xsl:otherwise>
-     <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: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>
-
-
-<!-- ABSOLUTE VALUE -->
-<xsl:template match="m:apply[m:abs]">
-  <xsl:param name="current_indent" select="0"/> 
-  <xsl:param name="width" select="$framewidth"/>
-  <xsl:variable name="uri">
-   <xsl:value-of select="m:abs/@definitionURL"/>
-  </xsl:variable>
-  <xsl:text>|</xsl:text>
-  <xsl:apply-templates select="*[2]">
-   <xsl:with-param name="current_indent" select="$current_indent + 2"/>
-  </xsl:apply-templates>
-  <xsl:text>|</xsl:text>
- </xsl:template>
-
-<!-- FACTORIAL -->
-
-<xsl:template match="m:apply[m:fact]">
-  <xsl:param name="current_indent" select="0"/> 
-  <xsl:param name="width" select="$framewidth"/>
-  <xsl:variable name="uri">
-   <xsl:value-of select="m:abs/@definitionURL"/>
-  </xsl:variable>
-  <xsl:apply-templates select="*[2]">
-   <xsl:with-param name="current_indent" select="$current_indent + 2"/>
-  </xsl:apply-templates>
-  <xsl:text>!</xsl:text>
- </xsl:template>
-
-<!-- SQUARE ROOT -->
-
-<xsl:template match="m:apply[m:root]">
-  <xsl:param name="current_indent" select="0"/> 
-  <xsl:param name="width" select="$framewidth"/>
-  <xsl:variable name="uri">
-   <xsl:value-of select="m:abs/@definitionURL"/>
-  </xsl:variable>
-  <xsl:text>(sqr</xsl:text>
-  <xsl:apply-templates select="*[2]">
-   <xsl:with-param name="current_indent" select="$current_indent + 5"/>
-  </xsl:apply-templates>
-  <xsl:text>)</xsl:text>
- </xsl:template>
-
-<!-- POWER -->
-
-<xsl:template match="m:apply[m:power]">
-  <xsl:param name="current_indent" select="0"/> 
-  <xsl:param name="width" select="$framewidth"/>
-  <xsl:variable name="uri">
-   <xsl:value-of select="m:power/@definitionURL"/>
-  </xsl:variable>
-  <xsl:apply-templates select="*[2]"/>
-  <SUP>
-  <xsl:apply-templates select="*[3]"/>
-  </SUP>
- </xsl:template>
-
-<!-- MIN and MAX (binari: estendere) -->
-
- <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="charlength">
-   <xsl:apply-templates select="*[1]" mode="charcount"/>
-  </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>
-  <xsl:choose>
-    <xsl:when test="$charlength > $framewidth">
-     <xsl:choose>
-     <xsl:when test="$uri != ''">
-      <a href="{$uri}">
-       <xsl:value-of select="$symbol"/>
-      </a>
-     </xsl:when>
-     <xsl:otherwise>
-      <xsl:value-of select="$symbol"/>
-     </xsl:otherwise>
-     </xsl:choose>
-     <xsl:text>{</xsl:text>
-     <xsl:apply-templates select="*[2]">
-      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
-     </xsl:apply-templates>
-     <xsl:text>,</xsl:text>
-     <BR/> 
-     <xsl:call-template name="make_indent">
-      <xsl:with-param name="current_indent" select="$current_indent + 5"/> 
-     </xsl:call-template>
-     <xsl:apply-templates select="*[3]">
-      <xsl:with-param name="current_indent" select="$current_indent + 2"/>
-     </xsl:apply-templates>
-     <xsl:text>}</xsl:text>
-    </xsl:when>
-    <xsl:otherwise>
-     <xsl:apply-templates mode="inline" select="."/>
-    </xsl:otherwise>
-   </xsl:choose>
- </xsl:template>
-
-<!-- COUNTING -->
-
-<xsl:template match="m:abs|m:fact|m:root|
-           m:sum|m:limit|m:diff|m:min|m:max" mode="charcount">
-<xsl:param name="incurrent_length" select="0"/> 
-    <xsl:choose>
-    <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
-     <xsl:variable name="siblength"><xsl:apply-templates select="following-sibling::*[position()=1]" mode="charcount"><xsl:with-param name="incurrent_length" select="$incurrent_length + string-length()"/></xsl:apply-templates></xsl:variable>
-     <xsl:choose>
-     <xsl:when test="string($siblength) = &quot;&quot;">
-      <xsl:value-of select="$incurrent_length + string-length()"/>
-     </xsl:when>
-     <xsl:otherwise>
-      <xsl:value-of select="number($siblength)"/>
-     </xsl:otherwise>
-     </xsl:choose>
-    </xsl:when>
-    <xsl:otherwise>
-     <xsl:value-of select="$incurrent_length + string-length()"/>
-    </xsl:otherwise>
-    </xsl:choose>
-</xsl:template> 
-
-</xsl:stylesheet>