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 <!--***********************************************************************-->
37 <xsl:template match="m:apply[m:in]">
38 <xsl:param name="current_indent" select="0"/>
39 <xsl:param name="width" select="$framewidth"/>
40 <xsl:variable name="uri">
41 <xsl:value-of select="m:in/@definitionURL"/>
43 <xsl:variable name="charlength">
44 <xsl:apply-templates select="m:in" mode="charcount"/>
47 <xsl:when test="$charlength > $framewidth">
48 <xsl:text>(</xsl:text>
49 <xsl:apply-templates select="*[2]">
50 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
51 </xsl:apply-templates>
53 <xsl:call-template name="make_indent">
54 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
57 <xsl:attribute name="href">
58 <xsl:value-of select="concat(string($header),string($uri))"/>
60 <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Î</FONT>
62 <xsl:apply-templates select="*[3]">
63 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
64 </xsl:apply-templates>
65 <xsl:text>)</xsl:text>
68 <xsl:text>(</xsl:text>
69 <xsl:apply-templates select="*[2]"/>
71 <xsl:attribute name="href">
72 <xsl:value-of select="concat(string($header),string($uri))"/>
74 <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Î</FONT>
76 <xsl:apply-templates select="*[3]"/>
77 <xsl:text>)</xsl:text>
84 <xsl:template match="m:apply[m:notin]">
85 <xsl:param name="current_indent" select="0"/>
86 <xsl:param name="width" select="$framewidth"/>
87 <xsl:variable name="uri">
88 <xsl:value-of select="m:notin/@definitionURL"/>
90 <xsl:variable name="charlength">
91 <xsl:apply-templates select="m:notin" mode="charcount"/>
94 <xsl:when test="$charlength > $framewidth">
95 <xsl:text>(</xsl:text>
96 <xsl:apply-templates select="*[2]">
97 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
98 </xsl:apply-templates>
100 <xsl:call-template name="make_indent">
101 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
103 <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Ï</FONT>
104 <xsl:apply-templates select="*[3]">
105 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
106 </xsl:apply-templates>
107 <xsl:text>)</xsl:text>
110 <xsl:text>(</xsl:text>
111 <xsl:apply-templates select="*[2]"/>
112 <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Ï</FONT>
113 <xsl:apply-templates select="*[3]"/>
114 <xsl:text>)</xsl:text>
121 <xsl:template match="m:set">
122 <xsl:param name="current_indent" select="0"/>
123 <xsl:param name="width" select="$framewidth"/>
124 <xsl:variable name="uri">
125 <xsl:value-of select="concat(string($absPath), @definitionURL)"/>
128 <xsl:when test="count(child::*) = 0">
129 <FONT FACE="symbol" mathcolor="blue">Æ</FONT>
132 <xsl:variable name="charlength">
133 <xsl:apply-templates select="." mode="charcount"/>
136 <xsl:when test="name(*[1]) = 'm:bvar'">
138 <xsl:when test="$charlength > $framewidth">
139 <xsl:text>{</xsl:text>
140 <xsl:apply-templates select="m:bvar/m:ci"/>
141 <xsl:text>:</xsl:text>
142 <xsl:apply-templates select="m:bvar/m:type">
143 <xsl:with-param name="current_indent"
144 select="$current_indent + 2 + string-length(m:bvar/m:ci)"/>
145 </xsl:apply-templates><BR/>
146 <xsl:call-template name="make_indent">
147 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
149 <xsl:text>|</xsl:text>
150 <xsl:apply-templates select="m:condition">
151 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
152 </xsl:apply-templates>
153 <xsl:text>}</xsl:text>
156 <xsl:text>{</xsl:text>
157 <xsl:apply-templates select="m:bvar/m:ci"/>
158 <xsl:text>:</xsl:text>
159 <xsl:apply-templates select="m:bvar/m:type"/>
160 <xsl:text>|</xsl:text>
161 <xsl:apply-templates select="*[position()=2]"/>
162 <xsl:text>}</xsl:text>
168 <xsl:when test="$charlength > $framewidth">
169 <xsl:text>{</xsl:text>
170 <xsl:apply-templates select="*[position()=1]">
171 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
172 </xsl:apply-templates>
173 <xsl:for-each select="*[position()>1]">
174 <xsl:text>,</xsl:text>
176 <xsl:call-template name="make_indent">
177 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
179 <xsl:apply-templates select=".">
180 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
181 </xsl:apply-templates>
183 <xsl:text>}</xsl:text>
186 <xsl:text>{</xsl:text>
187 <xsl:for-each select="*">
188 <xsl:apply-templates select="."/>
190 <xsl:when test="position() = last()">
191 <xsl:text>}</xsl:text>
194 <xsl:text>,</xsl:text>
207 <!-- INTERSECTION -->
209 <xsl:template match="m:apply[m:intersect]">
210 <xsl:param name="current_indent" select="0"/>
211 <xsl:param name="width" select="$framewidth"/>
212 <xsl:variable name="uri">
213 <xsl:value-of select="m:intersect/@definitionURL"/>
215 <xsl:variable name="charlength">
216 <xsl:apply-templates select="m:intersect" mode="charcount"/>
219 <xsl:when test="$charlength > $framewidth">
220 <xsl:text>(</xsl:text>
221 <xsl:apply-templates select="*[2]">
222 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
223 </xsl:apply-templates>
225 <xsl:call-template name="make_indent">
226 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
229 <xsl:attribute name="href">
230 <xsl:value-of select="concat(string($header),string($uri))"/>
232 <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Ç</FONT>
234 <xsl:apply-templates select="*[3]">
235 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
236 </xsl:apply-templates>
237 <xsl:text>)</xsl:text>
240 <xsl:text>(</xsl:text>
241 <xsl:apply-templates select="*[2]"/>
243 <xsl:attribute name="href">
244 <xsl:value-of select="concat(string($header),string($uri))"/>
246 <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Ç</FONT>
248 <xsl:apply-templates select="*[3]"/>
249 <xsl:text>)</xsl:text>
256 <xsl:template match="m:apply[m:union]">
257 <xsl:param name="current_indent" select="0"/>
258 <xsl:param name="width" select="$framewidth"/>
259 <xsl:variable name="uri">
260 <xsl:value-of select="m:union/@definitionURL"/>
262 <xsl:variable name="charlength">
263 <xsl:apply-templates select="m:union" mode="charcount"/>
266 <xsl:when test="$charlength > $framewidth">
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>
272 <xsl:call-template name="make_indent">
273 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
276 <xsl:attribute name="href">
277 <xsl:value-of select="concat(string($header),string($uri))"/>
279 <FONT FACE="symbol" SIZE="+2" mathcolor="blue">È</FONT>
281 <xsl:apply-templates select="*[3]">
282 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
283 </xsl:apply-templates>
284 <xsl:text>)</xsl:text>
287 <xsl:text>(</xsl:text>
288 <xsl:apply-templates select="*[2]"/>
290 <xsl:attribute name="href">
291 <xsl:value-of select="concat(string($header),string($uri))"/>
293 <FONT FACE="symbol" SIZE="+2" mathcolor="blue">È</FONT>
295 <xsl:apply-templates select="*[3]"/>
296 <xsl:text>)</xsl:text>
302 <xsl:template match="m:apply[m:subset]">
303 <xsl:param name="current_indent" select="0"/>
304 <xsl:param name="width" select="$framewidth"/>
305 <xsl:variable name="uri">
306 <xsl:value-of select="m:subset/@definitionURL"/>
308 <xsl:variable name="charlength">
309 <xsl:apply-templates select="m:subset" mode="charcount"/>
312 <xsl:when test="$charlength > $framewidth">
313 <xsl:text>(</xsl:text>
314 <xsl:apply-templates select="*[2]">
315 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
316 </xsl:apply-templates>
318 <xsl:call-template name="make_indent">
319 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
322 <xsl:attribute name="href">
323 <xsl:value-of select="concat(string($header),string($uri))"/>
325 <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Í</FONT>
327 <xsl:apply-templates select="*[3]">
328 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
329 </xsl:apply-templates>
330 <xsl:text>)</xsl:text>
333 <xsl:text>(</xsl:text>
334 <xsl:apply-templates select="*[2]"/>
336 <xsl:attribute name="href">
337 <xsl:value-of select="concat(string($header),string($uri))"/>
339 <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Í</FONT>
341 <xsl:apply-templates select="*[3]"/>
342 <xsl:text>)</xsl:text>
348 <xsl:template match="m:apply[m:prsubset]">
349 <xsl:param name="current_indent" select="0"/>
350 <xsl:param name="width" select="$framewidth"/>
351 <xsl:variable name="uri">
352 <xsl:value-of select="m:prsubset/@definitionURL"/>
354 <xsl:variable name="charlength">
355 <xsl:apply-templates select="m:prsubset" mode="charcount"/>
358 <xsl:when test="$charlength > $framewidth">
359 <xsl:text>(</xsl:text>
360 <xsl:apply-templates select="*[2]">
361 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
362 </xsl:apply-templates>
364 <xsl:call-template name="make_indent">
365 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
368 <xsl:attribute name="href">
369 <xsl:value-of select="concat(string($header),string($uri))"/>
371 <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Ì</FONT>
373 <xsl:apply-templates select="*[3]">
374 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
375 </xsl:apply-templates>
376 <xsl:text>)</xsl:text>
379 <xsl:text>(</xsl:text>
380 <xsl:apply-templates select="*[2]"/>
382 <xsl:attribute name="href">
383 <xsl:value-of select="concat(string($header),string($uri))"/>
385 <FONT FACE="symbol" SIZE="+2" mathcolor="blue">Ì</FONT>
387 <xsl:apply-templates select="*[3]"/>
388 <xsl:text>)</xsl:text>
396 <xsl:template match="m:apply[m:setdiff]">
397 <xsl:param name="current_indent" select="0"/>
398 <xsl:param name="width" select="$framewidth"/>
399 <xsl:variable name="uri">
400 <xsl:value-of select="m:setdiff/@definitionURL"/>
402 <xsl:variable name="charlength">
403 <xsl:apply-templates select="m:setdiff" mode="charcount"/>
406 <xsl:when test="$charlength > $framewidth">
407 <xsl:text>(</xsl:text>
408 <xsl:apply-templates select="*[2]">
409 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
410 </xsl:apply-templates>
412 <xsl:call-template name="make_indent">
413 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
416 <xsl:attribute name="href">
417 <xsl:value-of select="concat(string($header),string($uri))"/>
419 <xsl:text>/</xsl:text>
421 <xsl:apply-templates select="*[3]">
422 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
423 </xsl:apply-templates>
424 <xsl:text>)</xsl:text>
427 <xsl:text>(</xsl:text>
428 <xsl:apply-templates select="*[2]"/>
430 <xsl:attribute name="href">
431 <xsl:value-of select="concat(string($header),string($uri))"/>
433 <xsl:text>/</xsl:text>
435 <xsl:apply-templates select="*[3]"/>
436 <xsl:text>)</xsl:text>
442 <xsl:template match="m:apply[m:card]">
443 <xsl:param name="current_indent" select="0"/>
444 <xsl:param name="width" select="$framewidth"/>
445 <xsl:variable name="uri">
446 <xsl:value-of select="m:card/@definitionURL"/>
448 <xsl:text>|</xsl:text>
449 <xsl:apply-templates select="*[2]">
450 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
451 </xsl:apply-templates>
452 <xsl:text>|</xsl:text>
457 <xsl:template match="m:in|m:notin|m:intersect|m:union
458 |m:subset|m:prsubset|m:setdiff|m:card" mode="charcount">
459 <xsl:param name="incurrent_length" select="0"/>
461 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
462 <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>
464 <xsl:when test="string($siblength) = """>
465 <xsl:value-of select="$incurrent_length + string-length()"/>
468 <xsl:value-of select="number($siblength)"/>
473 <xsl:value-of select="$incurrent_length + string-length()"/>