3 <!-- Copyright (C) 2000, HELM Team -->
5 <!-- This file is part of HELM, an Hypertextual, Electronic -->
6 <!-- Library of Mathematics, developed at the Computer Science -->
7 <!-- Department, University of Bologna, Italy. -->
9 <!-- HELM is free software; you can redistribute it and/or -->
10 <!-- modify it under the terms of the GNU General Public License -->
11 <!-- as published by the Free Software Foundation; either version 2 -->
12 <!-- of the License, or (at your option) any later version. -->
14 <!-- HELM is distributed in the hope that it will be useful, -->
15 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
16 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
17 <!-- GNU General Public License for more details. -->
19 <!-- You should have received a copy of the GNU General Public License -->
20 <!-- along with HELM; if not, write to the Free Software -->
21 <!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, -->
22 <!-- MA 02111-1307, USA. -->
24 <!-- For details, see the HELM World-Wide-Web page, -->
25 <!-- http://cs.unibo.it/helm/. -->
27 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
28 xmlns:m="http://www.w3.org/1998/Math/MathML">
30 <!--***********************************************************************-->
31 <!-- INIT style for HTML -->
32 <!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena -->
33 <!--***********************************************************************-->
35 <!-- **************************************************************** -->
37 <!-- **************************************************************** -->
41 <xsl:template mode="inline" match="m:set">
42 <xsl:variable name="uri" select="@definitionURL"/>
43 <!-- <xsl:value-of select="concat(string($absPath), @definitionURL)"/>
46 <xsl:when test="count(child::*) = 0">
47 <FONT FACE="symbol" SIZE="+0" mathcolor="blue">Æ</FONT>
51 <xsl:when test="name(*[1]) = 'm:bvar'">
52 <xsl:text>{</xsl:text>
53 <xsl:apply-templates mode="inline" select="m:bvar/m:ci"/>
54 <xsl:text>:</xsl:text>
55 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
56 <xsl:text>|</xsl:text>
57 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
58 <xsl:text>}</xsl:text>
61 <xsl:text>{</xsl:text>
62 <xsl:for-each select="*">
63 <xsl:apply-templates mode="inline" select="."/>
65 <xsl:when test="position() = last()">
66 <xsl:text>}</xsl:text>
69 <xsl:text>,</xsl:text>
81 <xsl:template mode="inline" match="m:apply[m:card]">
82 <xsl:param name="current_indent" select="0"/>
83 <xsl:param name="width" select="$framewidth"/>
84 <xsl:variable name="uri">
85 <xsl:value-of select="m:card/@definitionURL"/>
87 <xsl:text>|</xsl:text>
88 <xsl:apply-templates mode="inline" select="*[2]"/>
89 <xsl:text>|</xsl:text>
92 <xsl:template mode="inline" match="m:apply[m:in|m:notin|m:intersect|m:union
93 |m:subset|m:prsubset|m:setdiff]">
94 <xsl:variable name="uri">
95 <xsl:value-of select="*[1]/@definitionURL"/>
97 <xsl:variable name="symbol">
99 <xsl:when test="m:in">
100 <xsl:value-of select="'Î'"/>
102 <xsl:when test="m:notin">
103 <xsl:value-of select="'Ï'"/>
105 <xsl:when test="m:intersect">
106 <xsl:value-of select="'Ç'"/>
108 <xsl:when test="m:union">
109 <xsl:value-of select="'È'"/>
111 <xsl:when test="m:subset">
112 <xsl:value-of select="'Í'"/>
114 <xsl:when test="m:prsubset">
115 <xsl:value-of select="'Ì'"/>
117 <xsl:when test="m:setdiff">
118 <xsl:value-of select="'/'"/>
122 <xsl:text>(</xsl:text>
123 <xsl:apply-templates mode="inline" select="*[2]"/>
125 <FONT FACE="symbol" SIZE="+0" mathcolor="blue">
126 <xsl:value-of select="$symbol"/>
129 <xsl:apply-templates mode="inline" select="*[3]"/>
130 <xsl:text>)</xsl:text>
133 <!-- *************************************************************** -->
135 <xsl:template match="m:apply[m:in|m:notin|m:intersect|m:union
136 |m:subset|m:prsubset|m:setdiff]">
137 <xsl:param name="current_indent" select="0"/>
138 <xsl:param name="width" select="$framewidth"/>
139 <xsl:variable name="uri">
140 <xsl:value-of select="*[1]/@definitionURL"/>
142 <xsl:variable name="charlength">
143 <xsl:apply-templates select="*[1]" mode="charcount"/>
145 <xsl:variable name="symbol">
147 <xsl:when test="m:in">
148 <xsl:value-of select="'Î'"/>
150 <xsl:when test="m:notin">
151 <xsl:value-of select="'Ï'"/>
153 <xsl:when test="m:intersect">
154 <xsl:value-of select="'Ç'"/>
156 <xsl:when test="m:union">
157 <xsl:value-of select="'È'"/>
159 <xsl:when test="m:subset">
160 <xsl:value-of select="'Í'"/>
162 <xsl:when test="m:prsubset">
163 <xsl:value-of select="'Ì'"/>
165 <xsl:when test="m:setdiff">
166 <xsl:value-of select="'/'"/>
171 <xsl:when test="$charlength > $framewidth">
172 <xsl:text>(</xsl:text>
173 <xsl:apply-templates select="*[2]">
174 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
175 </xsl:apply-templates>
177 <xsl:call-template name="make_indent">
178 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
181 <FONT FACE="symbol" SIZE="+0" mathcolor="blue">
182 <xsl:value-of select="$symbol"/>
185 <xsl:apply-templates select="*[3]">
186 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
187 </xsl:apply-templates>
188 <xsl:text>)</xsl:text>
191 <xsl:apply-templates mode="inline" select="."/>
199 <xsl:template match="m:set">
200 <xsl:param name="current_indent" select="0"/>
201 <xsl:param name="width" select="$framewidth"/>
202 <xsl:variable name="uri" select="@definitionURL"/>
203 <!-- <xsl:value-of select="concat(string($absPath), @definitionURL)"/>
206 <xsl:when test="count(child::*) = 0">
207 <FONT FACE="symbol" SIZE="+0" mathcolor="blue">Æ</FONT>
210 <xsl:variable name="charlength">
211 <xsl:apply-templates select="." mode="charcount"/>
214 <xsl:when test="$charlength > $framewidth">
216 <xsl:when test="name(*[1]) = 'm:bvar'">
217 <xsl:text>{</xsl:text>
218 <xsl:apply-templates select="m:bvar/m:ci"/>
219 <xsl:text>:</xsl:text>
220 <xsl:apply-templates select="m:bvar/m:type">
221 <xsl:with-param name="current_indent"
222 select="$current_indent + 2 + string-length(m:bvar/m:ci)"/>
223 </xsl:apply-templates><BR/>
224 <xsl:call-template name="make_indent">
225 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
227 <xsl:text>|</xsl:text>
228 <xsl:apply-templates select="m:condition">
229 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
230 </xsl:apply-templates>
231 <xsl:text>}</xsl:text>
234 <xsl:text>{</xsl:text>
235 <xsl:apply-templates select="*[position()=1]">
236 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
237 </xsl:apply-templates>
238 <xsl:for-each select="*[position()>1]">
239 <xsl:text>,</xsl:text>
241 <xsl:call-template name="make_indent">
242 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
244 <xsl:apply-templates select=".">
245 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
246 </xsl:apply-templates>
248 <xsl:text>}</xsl:text>
253 <xsl:apply-templates mode="inline" select="."/>
261 <xsl:template match="m:apply[m:card]">
262 <xsl:param name="current_indent" select="0"/>
263 <xsl:param name="width" select="$framewidth"/>
264 <xsl:variable name="uri">
265 <xsl:value-of select="m:card/@definitionURL"/>
267 <xsl:text>|</xsl:text>
268 <xsl:apply-templates select="*[2]">
269 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
270 </xsl:apply-templates>
271 <xsl:text>|</xsl:text>
276 <xsl:template match="m:in|m:notin|m:intersect|m:union
277 |m:subset|m:prsubset|m:setdiff|m:card" mode="charcount">
278 <xsl:param name="incurrent_length" select="0"/>
280 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
281 <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>
283 <xsl:when test="string($siblength) = """>
284 <xsl:value-of select="$incurrent_length + string-length()"/>
287 <xsl:value-of select="number($siblength)"/>
292 <xsl:value-of select="$incurrent_length + string-length()"/>