3 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:m="http://www.w3.org/1998/Math/MathML">
6 <!--***********************************************************************-->
7 <!-- INIT style for HTML -->
8 <!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena -->
9 <!--***********************************************************************-->
11 <xsl:variable name="absPath">http://localhost:8081/get?url=</xsl:variable>
15 <xsl:template match="m:apply[m:in]">
16 <xsl:param name="current_indent" select="0"/>
17 <xsl:param name="width" select="$framewidth"/>
18 <xsl:variable name="uri">
19 <xsl:value-of select="m:in/@definitionURL"/>
21 <xsl:variable name="charlength">
22 <xsl:apply-templates select="m:in" mode="charcount"/>
25 <xsl:when test="$charlength > $framewidth">
26 <xsl:text>(</xsl:text>
27 <xsl:apply-templates select="*[2]">
28 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
29 </xsl:apply-templates>
31 <xsl:call-template name="make_indent">
32 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
35 <xsl:attribute name="href">
36 <xsl:value-of select="concat(string($header),string($uri))"/>
38 <FONT FACE="symbol" SIZE="+2" color="blue">Î</FONT>
40 <xsl:apply-templates select="*[3]">
41 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
42 </xsl:apply-templates>
43 <xsl:text>)</xsl:text>
46 <xsl:text>(</xsl:text>
47 <xsl:apply-templates select="*[2]"/>
49 <xsl:attribute name="href">
50 <xsl:value-of select="concat(string($header),string($uri))"/>
52 <FONT FACE="symbol" SIZE="+2" color="blue">Î</FONT>
54 <xsl:apply-templates select="*[3]"/>
55 <xsl:text>)</xsl:text>
62 <xsl:template match="m:apply[m:notin]">
63 <xsl:param name="current_indent" select="0"/>
64 <xsl:param name="width" select="$framewidth"/>
65 <xsl:variable name="uri">
66 <xsl:value-of select="m:notin/@definitionURL"/>
68 <xsl:variable name="charlength">
69 <xsl:apply-templates select="m:notin" mode="charcount"/>
72 <xsl:when test="$charlength > $framewidth">
73 <xsl:text>(</xsl:text>
74 <xsl:apply-templates select="*[2]">
75 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
76 </xsl:apply-templates>
78 <xsl:call-template name="make_indent">
79 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
81 <FONT FACE="symbol" SIZE="+2" color="blue">Ï</FONT>
82 <xsl:apply-templates select="*[3]">
83 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
84 </xsl:apply-templates>
85 <xsl:text>)</xsl:text>
88 <xsl:text>(</xsl:text>
89 <xsl:apply-templates select="*[2]"/>
90 <FONT FACE="symbol" SIZE="+2" color="blue">Ï</FONT>
91 <xsl:apply-templates select="*[3]"/>
92 <xsl:text>)</xsl:text>
99 <xsl:template match="m:set">
100 <xsl:param name="current_indent" select="0"/>
101 <xsl:param name="width" select="$framewidth"/>
102 <xsl:variable name="uri">
103 <xsl:value-of select="concat(string($absPath), @definitionURL)"/>
106 <xsl:when test="count(child::*) = 0">
107 <FONT FACE="symbol" color="blue">Æ</FONT>
110 <xsl:variable name="charlength">
111 <xsl:apply-templates select="." mode="charcount"/>
114 <xsl:when test="name(*[1]) = 'm:bvar'">
116 <xsl:when test="$charlength > $framewidth">
117 <xsl:text>{</xsl:text>
118 <xsl:apply-templates select="m:bvar/m:ci"/>
119 <xsl:text>:</xsl:text>
120 <xsl:apply-templates select="m:bvar/m:type">
121 <xsl:with-param name="current_indent"
122 select="$current_indent + 2 + string-length(m:bvar/m:ci)"/>
123 </xsl:apply-templates><BR/>
124 <xsl:call-template name="make_indent">
125 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
127 <xsl:text>|</xsl:text>
128 <xsl:apply-templates select="m:condition">
129 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
130 </xsl:apply-templates>
131 <xsl:text>}</xsl:text>
134 <xsl:text>{</xsl:text>
135 <xsl:apply-templates select="m:bvar/m:ci"/>
136 <xsl:text>:</xsl:text>
137 <xsl:apply-templates select="m:bvar/m:type"/>
138 <xsl:text>|</xsl:text>
139 <xsl:apply-templates select="*[position()=2]"/>
140 <xsl:text>}</xsl:text>
146 <xsl:when test="$charlength > $framewidth">
147 <xsl:text>{</xsl:text>
148 <xsl:apply-templates select="*[position()=1]">
149 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
150 </xsl:apply-templates>
151 <xsl:for-each select="*[position()>1]">
152 <xsl:text>,</xsl:text>
154 <xsl:call-template name="make_indent">
155 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
157 <xsl:apply-templates select=".">
158 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
159 </xsl:apply-templates>
161 <xsl:text>}</xsl:text>
164 <xsl:text>{</xsl:text>
165 <xsl:for-each select="*">
166 <xsl:apply-templates select="."/>
168 <xsl:when test="position() = last()">
169 <xsl:text>}</xsl:text>
172 <xsl:text>,</xsl:text>
185 <!-- INTERSECTION -->
187 <xsl:template match="m:apply[m:intersect]">
188 <xsl:param name="current_indent" select="0"/>
189 <xsl:param name="width" select="$framewidth"/>
190 <xsl:variable name="uri">
191 <xsl:value-of select="m:intersect/@definitionURL"/>
193 <xsl:variable name="charlength">
194 <xsl:apply-templates select="m:intersect" mode="charcount"/>
197 <xsl:when test="$charlength > $framewidth">
198 <xsl:text>(</xsl:text>
199 <xsl:apply-templates select="*[2]">
200 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
201 </xsl:apply-templates>
203 <xsl:call-template name="make_indent">
204 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
207 <xsl:attribute name="href">
208 <xsl:value-of select="concat(string($header),string($uri))"/>
210 <FONT FACE="symbol" SIZE="+2" color="blue">Ç</FONT>
212 <xsl:apply-templates select="*[3]">
213 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
214 </xsl:apply-templates>
215 <xsl:text>)</xsl:text>
218 <xsl:text>(</xsl:text>
219 <xsl:apply-templates select="*[2]"/>
221 <xsl:attribute name="href">
222 <xsl:value-of select="concat(string($header),string($uri))"/>
224 <FONT FACE="symbol" SIZE="+2" color="blue">Ç</FONT>
226 <xsl:apply-templates select="*[3]"/>
227 <xsl:text>)</xsl:text>
234 <xsl:template match="m:apply[m:union]">
235 <xsl:param name="current_indent" select="0"/>
236 <xsl:param name="width" select="$framewidth"/>
237 <xsl:variable name="uri">
238 <xsl:value-of select="m:union/@definitionURL"/>
240 <xsl:variable name="charlength">
241 <xsl:apply-templates select="m:union" mode="charcount"/>
244 <xsl:when test="$charlength > $framewidth">
245 <xsl:text>(</xsl:text>
246 <xsl:apply-templates select="*[2]">
247 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
248 </xsl:apply-templates>
250 <xsl:call-template name="make_indent">
251 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
254 <xsl:attribute name="href">
255 <xsl:value-of select="concat(string($header),string($uri))"/>
257 <FONT FACE="symbol" SIZE="+2" color="blue">È</FONT>
259 <xsl:apply-templates select="*[3]">
260 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
261 </xsl:apply-templates>
262 <xsl:text>)</xsl:text>
265 <xsl:text>(</xsl:text>
266 <xsl:apply-templates select="*[2]"/>
268 <xsl:attribute name="href">
269 <xsl:value-of select="concat(string($header),string($uri))"/>
271 <FONT FACE="symbol" SIZE="+2" color="blue">È</FONT>
273 <xsl:apply-templates select="*[3]"/>
274 <xsl:text>)</xsl:text>
280 <xsl:template match="m:apply[m:subset]">
281 <xsl:param name="current_indent" select="0"/>
282 <xsl:param name="width" select="$framewidth"/>
283 <xsl:variable name="uri">
284 <xsl:value-of select="m:subset/@definitionURL"/>
286 <xsl:variable name="charlength">
287 <xsl:apply-templates select="m:subset" mode="charcount"/>
290 <xsl:when test="$charlength > $framewidth">
291 <xsl:text>(</xsl:text>
292 <xsl:apply-templates select="*[2]">
293 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
294 </xsl:apply-templates>
296 <xsl:call-template name="make_indent">
297 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
300 <xsl:attribute name="href">
301 <xsl:value-of select="concat(string($header),string($uri))"/>
303 <FONT FACE="symbol" SIZE="+2" color="blue">Í</FONT>
305 <xsl:apply-templates select="*[3]">
306 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
307 </xsl:apply-templates>
308 <xsl:text>)</xsl:text>
311 <xsl:text>(</xsl:text>
312 <xsl:apply-templates select="*[2]"/>
314 <xsl:attribute name="href">
315 <xsl:value-of select="concat(string($header),string($uri))"/>
317 <FONT FACE="symbol" SIZE="+2" color="blue">Í</FONT>
319 <xsl:apply-templates select="*[3]"/>
320 <xsl:text>)</xsl:text>
326 <xsl:template match="m:apply[m:prsubset]">
327 <xsl:param name="current_indent" select="0"/>
328 <xsl:param name="width" select="$framewidth"/>
329 <xsl:variable name="uri">
330 <xsl:value-of select="m:prsubset/@definitionURL"/>
332 <xsl:variable name="charlength">
333 <xsl:apply-templates select="m:prsubset" mode="charcount"/>
336 <xsl:when test="$charlength > $framewidth">
337 <xsl:text>(</xsl:text>
338 <xsl:apply-templates select="*[2]">
339 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
340 </xsl:apply-templates>
342 <xsl:call-template name="make_indent">
343 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
346 <xsl:attribute name="href">
347 <xsl:value-of select="concat(string($header),string($uri))"/>
349 <FONT FACE="symbol" SIZE="+2" color="blue">Ì</FONT>
351 <xsl:apply-templates select="*[3]">
352 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
353 </xsl:apply-templates>
354 <xsl:text>)</xsl:text>
357 <xsl:text>(</xsl:text>
358 <xsl:apply-templates select="*[2]"/>
360 <xsl:attribute name="href">
361 <xsl:value-of select="concat(string($header),string($uri))"/>
363 <FONT FACE="symbol" SIZE="+2" color="blue">Ì</FONT>
365 <xsl:apply-templates select="*[3]"/>
366 <xsl:text>)</xsl:text>
374 <xsl:template match="m:apply[m:setdiff]">
375 <xsl:param name="current_indent" select="0"/>
376 <xsl:param name="width" select="$framewidth"/>
377 <xsl:variable name="uri">
378 <xsl:value-of select="m:setdiff/@definitionURL"/>
380 <xsl:variable name="charlength">
381 <xsl:apply-templates select="m:setdiff" mode="charcount"/>
384 <xsl:when test="$charlength > $framewidth">
385 <xsl:text>(</xsl:text>
386 <xsl:apply-templates select="*[2]">
387 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
388 </xsl:apply-templates>
390 <xsl:call-template name="make_indent">
391 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
394 <xsl:attribute name="href">
395 <xsl:value-of select="concat(string($header),string($uri))"/>
397 <xsl:text>/</xsl:text>
399 <xsl:apply-templates select="*[3]">
400 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
401 </xsl:apply-templates>
402 <xsl:text>)</xsl:text>
405 <xsl:text>(</xsl:text>
406 <xsl:apply-templates select="*[2]"/>
408 <xsl:attribute name="href">
409 <xsl:value-of select="concat(string($header),string($uri))"/>
411 <xsl:text>/</xsl:text>
413 <xsl:apply-templates select="*[3]"/>
414 <xsl:text>)</xsl:text>
420 <xsl:template match="m:apply[m:card]">
421 <xsl:param name="current_indent" select="0"/>
422 <xsl:param name="width" select="$framewidth"/>
423 <xsl:variable name="uri">
424 <xsl:value-of select="m:card/@definitionURL"/>
426 <xsl:text>|</xsl:text>
427 <xsl:apply-templates select="*[2]">
428 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
429 </xsl:apply-templates>
430 <xsl:text>|</xsl:text>
435 <xsl:template match="m:in|m:notin|m:intersect|m:union
436 |m:subset|m:prsubset|m:setdiff|m:card" mode="charcount">
437 <xsl:param name="incurrent_length" select="0"/>
439 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
440 <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>
442 <xsl:when test="string($siblength) = """>
443 <xsl:value-of select="$incurrent_length + string-length()"/>
446 <xsl:value-of select="number($siblength)"/>
451 <xsl:value-of select="$incurrent_length + string-length()"/>