<!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena -->
<!--***********************************************************************-->
-<xsl:variable name="absPath">http://localhost:8081/getciconly?uri=</xsl:variable>
+<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>
-<!-- IN -->
+<!-- **************************************************************** -->
+<!-- INLINE MODE -->
+<!-- **************************************************************** -->
- <xsl:template match="m:apply[m:in]">
+<!-- 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:in/@definitionURL"/>
- </xsl:variable>
- <xsl:variable name="charlength">
- <xsl:apply-templates select="m:in" mode="charcount"/>
+ <xsl:value-of select="m:card/@definitionURL"/>
</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>
- <a>
- <xsl:attribute name="href">
- <xsl:value-of select="concat(string($header),string($uri))"/>
- </xsl:attribute>
- <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Î</FONT>
- </a>
- <xsl:apply-templates select="*[3]">
- <xsl:with-param name="current_indent" select="$current_indent + 2"/>
- </xsl:apply-templates>
- <xsl:text>)</xsl:text>
+ <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:otherwise>
- <xsl:text>(</xsl:text>
- <xsl:apply-templates select="*[2]"/>
- <a>
- <xsl:attribute name="href">
- <xsl:value-of select="concat(string($header),string($uri))"/>
- </xsl:attribute>
- <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Î</FONT>
- </a>
- <xsl:apply-templates select="*[3]"/>
- <xsl:text>)</xsl:text>
- </xsl:otherwise>
</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>
-<!-- NOTIN -->
+<!-- *************************************************************** -->
- <xsl:template match="m:apply[m:notin]">
+<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="m:notin/@definitionURL"/>
- </xsl:variable>
+ <xsl:variable name="uri"><xsl:value-of select="*[1]/@definitionURL"/></xsl:variable>
<xsl:variable name="charlength">
- <xsl:apply-templates select="m:notin" mode="charcount"/>
+ <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:call-template name="make_indent">
<xsl:with-param name="current_indent" select="$current_indent + 2"/>
</xsl:call-template>
- <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Ï</FONT>
+ <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:text>(</xsl:text>
- <xsl:apply-templates select="*[2]"/>
- <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Ï</FONT>
- <xsl:apply-templates select="*[3]"/>
- <xsl:text>)</xsl:text>
+ <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">
- <xsl:value-of select="concat(string($absPath), @definitionURL)"/>
- </xsl:variable>
+ <xsl:variable name="uri" select="@definitionURL"/>
<xsl:choose>
<xsl:when test="count(child::*) = 0">
- <FONT FACE="symbol" mathcolor="blue">Æ</FONT>
+ <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="name(*[1]) = 'm:bvar'">
+ <xsl:when test="$charlength > $framewidth">
<xsl:choose>
- <xsl:when test="$charlength > $framewidth">
+ <xsl:when test="name(*[1]) = 'm:bvar'">
<xsl:text>{</xsl:text>
<xsl:apply-templates select="m:bvar/m:ci"/>
<xsl:text>:</xsl:text>
<xsl:text>}</xsl:text>
</xsl:when>
<xsl:otherwise>
- <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:text>|</xsl:text>
- <xsl:apply-templates select="*[position()=2]"/>
- <xsl:text>}</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$charlength > $framewidth">
<xsl:text>{</xsl:text>
<xsl:apply-templates select="*[position()=1]">
<xsl:with-param name="current_indent" select="$current_indent + 2"/>
<xsl:with-param name="current_indent" select="$current_indent + 2"/>
</xsl:apply-templates>
</xsl:for-each>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>{</xsl:text>
- <xsl:for-each select="*">
- <xsl:apply-templates 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:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
-<!-- INTERSECTION -->
-
-<xsl:template match="m:apply[m:intersect]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri">
- <xsl:value-of select="m:intersect/@definitionURL"/>
- </xsl:variable>
- <xsl:variable name="charlength">
- <xsl:apply-templates select="m:intersect" mode="charcount"/>
- </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>
- <a>
- <xsl:attribute name="href">
- <xsl:value-of select="concat(string($header),string($uri))"/>
- </xsl:attribute>
- <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Ç</FONT>
- </a>
- <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:text>(</xsl:text>
- <xsl:apply-templates select="*[2]"/>
- <a>
- <xsl:attribute name="href">
- <xsl:value-of select="concat(string($header),string($uri))"/>
- </xsl:attribute>
- <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Ç</FONT>
- </a>
- <xsl:apply-templates select="*[3]"/>
- <xsl:text>)</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-<!-- UNION -->
-
-<xsl:template match="m:apply[m:union]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri">
- <xsl:value-of select="m:union/@definitionURL"/>
- </xsl:variable>
- <xsl:variable name="charlength">
- <xsl:apply-templates select="m:union" mode="charcount"/>
- </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>
- <a>
- <xsl:attribute name="href">
- <xsl:value-of select="concat(string($header),string($uri))"/>
- </xsl:attribute>
- <FONT FACE="symbol" SIZE="+2" mathcolor="blue">È</FONT>
- </a>
- <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:text>(</xsl:text>
- <xsl:apply-templates select="*[2]"/>
- <a>
- <xsl:attribute name="href">
- <xsl:value-of select="concat(string($header),string($uri))"/>
- </xsl:attribute>
- <FONT FACE="symbol" SIZE="+2" mathcolor="blue">È</FONT>
- </a>
- <xsl:apply-templates select="*[3]"/>
- <xsl:text>)</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-<!-- SUBSET -->
-<xsl:template match="m:apply[m:subset]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri">
- <xsl:value-of select="m:subset/@definitionURL"/>
- </xsl:variable>
- <xsl:variable name="charlength">
- <xsl:apply-templates select="m:subset" mode="charcount"/>
- </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>
- <a>
- <xsl:attribute name="href">
- <xsl:value-of select="concat(string($header),string($uri))"/>
- </xsl:attribute>
- <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Í</FONT>
- </a>
- <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:text>(</xsl:text>
- <xsl:apply-templates select="*[2]"/>
- <a>
- <xsl:attribute name="href">
- <xsl:value-of select="concat(string($header),string($uri))"/>
- </xsl:attribute>
- <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Í</FONT>
- </a>
- <xsl:apply-templates select="*[3]"/>
- <xsl:text>)</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-<!-- PRSUBSET -->
-<xsl:template match="m:apply[m:prsubset]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri">
- <xsl:value-of select="m:prsubset/@definitionURL"/>
- </xsl:variable>
- <xsl:variable name="charlength">
- <xsl:apply-templates select="m:prsubset" mode="charcount"/>
- </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>
- <a>
- <xsl:attribute name="href">
- <xsl:value-of select="concat(string($header),string($uri))"/>
- </xsl:attribute>
- <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Ì</FONT>
- </a>
- <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:text>(</xsl:text>
- <xsl:apply-templates select="*[2]"/>
- <a>
- <xsl:attribute name="href">
- <xsl:value-of select="concat(string($header),string($uri))"/>
- </xsl:attribute>
- <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Ì</FONT>
- </a>
- <xsl:apply-templates select="*[3]"/>
- <xsl:text>)</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
-<!-- SETDIFF -->
-
-<xsl:template match="m:apply[m:setdiff]">
- <xsl:param name="current_indent" select="0"/>
- <xsl:param name="width" select="$framewidth"/>
- <xsl:variable name="uri">
- <xsl:value-of select="m:setdiff/@definitionURL"/>
- </xsl:variable>
- <xsl:variable name="charlength">
- <xsl:apply-templates select="m:setdiff" mode="charcount"/>
- </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>
- <a>
- <xsl:attribute name="href">
- <xsl:value-of select="concat(string($header),string($uri))"/>
- </xsl:attribute>
- <xsl:text>/</xsl:text>
- </a>
- <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:text>(</xsl:text>
- <xsl:apply-templates select="*[2]"/>
- <a>
- <xsl:attribute name="href">
- <xsl:value-of select="concat(string($header),string($uri))"/>
- </xsl:attribute>
- <xsl:text>/</xsl:text>
- </a>
- <xsl:apply-templates select="*[3]"/>
- <xsl:text>)</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ <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:template>
</xsl:stylesheet>
-
-
-
-
-
-
-