+++ /dev/null
-<?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">
- <xsl:param name="symbol" select="''"/>
- <xsl:choose>
- <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">
- <xsl:variable name="fontsymbol">
- <xsl:choose>
- <xsl:when test="$symbol = 'emptyset'">
- <xsl:value-of select="'Æ'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'in'">
- <xsl:value-of select="'Î'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'notin'">
- <xsl:value-of select="'Ï'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'intersect'">
- <xsl:value-of select="'Ç'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'union'">
- <xsl:value-of select="'È'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'subset'">
- <xsl:value-of select="'Í'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'prsubset'">
- <xsl:value-of select="'Ì'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'setdiff'">
- <xsl:value-of select="'/'"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <FONT FACE="symbol" mathcolor="blue">
- <xsl:value-of select="$fontsymbol"/>
- </FONT>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="unicodesymbol">
- <xsl:choose>
- <xsl:when test="$symbol = 'emptyset'">
- <xsl:value-of select="'∅'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'in'">
- <xsl:value-of select="'∈'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'notin'">
- <xsl:value-of select="'∉'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'intersect'">
- <xsl:value-of select="'∩'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'union'">
- <xsl:value-of select="'∪'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'subset'">
- <xsl:value-of select="'⊆'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'prsubset'">
- <xsl:value-of select="'⊂'"/>
- </xsl:when>
- <xsl:when test="$symbol = 'setdiff'">
- <xsl:value-of select="'/'"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="$unicodesymbol"/>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<!-- **************************************************************** -->
-<!-- INLINE MODE -->
-<!-- **************************************************************** -->
-
-<!-- SET -->
-
- <xsl:template mode="inline" match="m:set">
- <xsl:variable name="uri" select="@definitionURL"/>
- <xsl:choose>
- <xsl:when test="count(child::*) = 0">
- <xsl:call-template name="mksymbol">
- <xsl:with-param name="symbol" select="'emptyset'"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="name(*[1]) = 'm:bvar'">
- <xsl:text>{</xsl:text>
- <xsl:apply-templates mode="inline" select="m:bvar/m:ci"/>
- <xsl:text>:</xsl:text>
- <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
- <xsl:text>|</xsl:text>
- <xsl:apply-templates mode="inline" select="*[position()=2]"/>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>{</xsl:text>
- <xsl:for-each select="*">
- <xsl:apply-templates mode="inline" select="."/>
- <xsl:choose>
- <xsl:when test="position() = last()">
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>,</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
-<!-- CARD -->
-<xsl:template mode="inline" match="m:apply[m:card]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri">
- <xsl:value-of select="m:card/@definitionURL"/>
- </xsl:variable>
- <xsl:text>|</xsl:text>
- <xsl:apply-templates mode="inline" select="*[2]"/>
- <xsl:text>|</xsl:text>
- </xsl:template>
-
-<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="symbol">
- <xsl:choose>
- <xsl:when test="m:in">
- <xsl:value-of select="'Î'"/>
- </xsl:when>
- <xsl:when test="m:notin">
- <xsl:value-of select="'Ï'"/>
- </xsl:when>
- <xsl:when test="m:intersect">
- <xsl:value-of select="'Ç'"/>
- </xsl:when>
- <xsl:when test="m:union">
- <xsl:value-of select="'È'"/>
- </xsl:when>
- <xsl:when test="m:subset">
- <xsl:value-of select="'Í'"/>
- </xsl:when>
- <xsl:when test="m:prsubset">
- <xsl:value-of select="'Ì'"/>
- </xsl:when>
- <xsl:when test="m:setdiff">
- <xsl:value-of select="'/'"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:text>(</xsl:text>
- <xsl:apply-templates mode="inline" select="*[2]"/>
- <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>
-
-<!-- *************************************************************** -->
-
-<xsl:template match="m:apply[m:in|m:notin|m:intersect|m:union
- |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="charlength">
- <xsl:apply-templates select="*[1]" mode="charcount"/>
- </xsl:variable>
- <xsl:variable name="symbol">
- <xsl:choose>
- <xsl:when test="m:in">
- <xsl:value-of select="'Î'"/>
- </xsl:when>
- <xsl:when test="m:notin">
- <xsl:value-of select="'Ï'"/>
- </xsl:when>
- <xsl:when test="m:intersect">
- <xsl:value-of select="'Ç'"/>
- </xsl:when>
- <xsl:when test="m:union">
- <xsl:value-of select="'È'"/>
- </xsl:when>
- <xsl:when test="m:subset">
- <xsl:value-of select="'Í'"/>
- </xsl:when>
- <xsl:when test="m:prsubset">
- <xsl:value-of select="'Ì'"/>
- </xsl:when>
- <xsl:when test="m:setdiff">
- <xsl:value-of select="'/'"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$charlength > $framewidth">
- <xsl:text>(</xsl:text>
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <BR/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <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>
- <xsl:text>)</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="inline" select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
-<!-- SET -->
-
- <xsl:template match="m:set">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri" select="@definitionURL"/>
- <xsl:choose>
- <xsl:when test="count(child::*) = 0">
- <xsl:call-template name="mksymbol">
- <xsl:with-param name="symbol" select="'emptyset'"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="charlength">
- <xsl:apply-templates select="." mode="charcount"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$charlength > $framewidth">
- <xsl:choose>
- <xsl:when test="name(*[1]) = 'm:bvar'">
- <xsl:text>{</xsl:text>
- <xsl:apply-templates select="m:bvar/m:ci"/>
- <xsl:text>:</xsl:text>
- <xsl:apply-templates select="m:bvar/m:type">
- <xsl:with-param name="current_indent"
- select="$current_indent + 2 + string-length(m:bvar/m:ci)"/>
- </xsl:apply-templates><BR/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <xsl:text>|</xsl:text>
- <xsl:apply-templates select="m:condition">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>{</xsl:text>
- <xsl:apply-templates select="*[position()=1]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <xsl:for-each select="*[position()>1]">
- <xsl:text>,</xsl:text>
- <BR/>
- <xsl:call-template name="make_indent">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:call-template>
- <xsl:apply-templates select=".">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- </xsl:for-each>
- <xsl:text>}</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="inline" select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-<!-- CARD -->
-<xsl:template match="m:apply[m:card]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri">
- <xsl:value-of select="m:card/@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>
-
-<!-- COUNTING -->
-
-<xsl:template match="m:in|m:notin|m:intersect|m:union
- |m:subset|m:prsubset|m:setdiff|m:card" 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) = """>
- <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>