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 <xsl:template name="mksymbol">
36 <xsl:param name="symbol" select="''"/>
38 <xsl:when test="$UNICODEvsSYMBOL = 'symbol'">
39 <xsl:variable name="fontsymbol">
41 <xsl:when test="$symbol = 'emptyset'">
42 <xsl:value-of select="'Æ'"/>
44 <xsl:when test="$symbol = 'in'">
45 <xsl:value-of select="'Î'"/>
47 <xsl:when test="$symbol = 'notin'">
48 <xsl:value-of select="'Ï'"/>
50 <xsl:when test="$symbol = 'intersect'">
51 <xsl:value-of select="'Ç'"/>
53 <xsl:when test="$symbol = 'union'">
54 <xsl:value-of select="'È'"/>
56 <xsl:when test="$symbol = 'subset'">
57 <xsl:value-of select="'Í'"/>
59 <xsl:when test="$symbol = 'prsubset'">
60 <xsl:value-of select="'Ì'"/>
62 <xsl:when test="$symbol = 'setdiff'">
63 <xsl:value-of select="'/'"/>
67 <FONT FACE="symbol" mathcolor="blue">
68 <xsl:value-of select="$fontsymbol"/>
72 <xsl:variable name="unicodesymbol">
74 <xsl:when test="$symbol = 'emptyset'">
75 <xsl:value-of select="'∅'"/>
77 <xsl:when test="$symbol = 'in'">
78 <xsl:value-of select="'∈'"/>
80 <xsl:when test="$symbol = 'notin'">
81 <xsl:value-of select="'∉'"/>
83 <xsl:when test="$symbol = 'intersect'">
84 <xsl:value-of select="'∩'"/>
86 <xsl:when test="$symbol = 'union'">
87 <xsl:value-of select="'∪'"/>
89 <xsl:when test="$symbol = 'subset'">
90 <xsl:value-of select="'⊆'"/>
92 <xsl:when test="$symbol = 'prsubset'">
93 <xsl:value-of select="'⊂'"/>
95 <xsl:when test="$symbol = 'setdiff'">
96 <xsl:value-of select="'/'"/>
100 <xsl:value-of select="$unicodesymbol"/>
105 <!-- **************************************************************** -->
107 <!-- **************************************************************** -->
111 <xsl:template mode="inline" match="m:set">
112 <xsl:variable name="uri" select="@definitionURL"/>
113 <!-- <xsl:value-of select="concat(string($absPath), @definitionURL)"/>
116 <xsl:when test="count(child::*) = 0">
117 <xsl:call-template name="mksymbol">
118 <xsl:with-param name="symbol" select="'emptyset'"/>
123 <xsl:when test="name(*[1]) = 'm:bvar'">
124 <xsl:text>{</xsl:text>
125 <xsl:apply-templates mode="inline" select="m:bvar/m:ci"/>
126 <xsl:text>:</xsl:text>
127 <xsl:apply-templates mode="inline" select="m:bvar/m:type"/>
128 <xsl:text>|</xsl:text>
129 <xsl:apply-templates mode="inline" select="*[position()=2]"/>
130 <xsl:text>}</xsl:text>
133 <xsl:text>{</xsl:text>
134 <xsl:for-each select="*">
135 <xsl:apply-templates mode="inline" select="."/>
137 <xsl:when test="position() = last()">
138 <xsl:text>}</xsl:text>
141 <xsl:text>,</xsl:text>
153 <xsl:template mode="inline" match="m:apply[m:card]">
154 <xsl:param name="current_indent" select="0"/>
155 <xsl:param name="width" select="$framewidth"/>
156 <xsl:variable name="uri">
157 <xsl:value-of select="m:card/@definitionURL"/>
159 <xsl:text>|</xsl:text>
160 <xsl:apply-templates mode="inline" select="*[2]"/>
161 <xsl:text>|</xsl:text>
164 <xsl:template mode="inline" match="m:apply[m:in|m:notin|m:intersect|m:union
165 |m:subset|m:prsubset|m:setdiff]">
166 <xsl:variable name="uri">
167 <xsl:value-of select="*[1]/@definitionURL"/>
169 <xsl:variable name="symbol">
171 <xsl:when test="m:in">
172 <xsl:value-of select="'Î'"/>
174 <xsl:when test="m:notin">
175 <xsl:value-of select="'Ï'"/>
177 <xsl:when test="m:intersect">
178 <xsl:value-of select="'Ç'"/>
180 <xsl:when test="m:union">
181 <xsl:value-of select="'È'"/>
183 <xsl:when test="m:subset">
184 <xsl:value-of select="'Í'"/>
186 <xsl:when test="m:prsubset">
187 <xsl:value-of select="'Ì'"/>
189 <xsl:when test="m:setdiff">
190 <xsl:value-of select="'/'"/>
194 <xsl:text>(</xsl:text>
195 <xsl:apply-templates mode="inline" select="*[2]"/>
197 <xsl:call-template name="mksymbol">
198 <xsl:with-param name="symbol">
199 <xsl:value-of select="local-name(*[1])"/>
203 <xsl:apply-templates mode="inline" select="*[3]"/>
204 <xsl:text>)</xsl:text>
207 <!-- *************************************************************** -->
209 <xsl:template match="m:apply[m:in|m:notin|m:intersect|m:union
210 |m:subset|m:prsubset|m:setdiff]">
211 <xsl:param name="current_indent" select="0"/>
212 <xsl:param name="width" select="$framewidth"/>
213 <xsl:variable name="uri">
214 <xsl:value-of select="*[1]/@definitionURL"/>
216 <xsl:variable name="charlength">
217 <xsl:apply-templates select="*[1]" mode="charcount"/>
219 <xsl:variable name="symbol">
221 <xsl:when test="m:in">
222 <xsl:value-of select="'Î'"/>
224 <xsl:when test="m:notin">
225 <xsl:value-of select="'Ï'"/>
227 <xsl:when test="m:intersect">
228 <xsl:value-of select="'Ç'"/>
230 <xsl:when test="m:union">
231 <xsl:value-of select="'È'"/>
233 <xsl:when test="m:subset">
234 <xsl:value-of select="'Í'"/>
236 <xsl:when test="m:prsubset">
237 <xsl:value-of select="'Ì'"/>
239 <xsl:when test="m:setdiff">
240 <xsl:value-of select="'/'"/>
245 <xsl:when test="$charlength > $framewidth">
246 <xsl:text>(</xsl:text>
247 <xsl:apply-templates select="*[2]">
248 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
249 </xsl:apply-templates>
251 <xsl:call-template name="make_indent">
252 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
255 <xsl:call-template name="mksymbol">
256 <xsl:with-param name="symbol">
257 <xsl:value-of select="local-name(*[1])"/>
261 <xsl:apply-templates select="*[3]">
262 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
263 </xsl:apply-templates>
264 <xsl:text>)</xsl:text>
267 <xsl:apply-templates mode="inline" select="."/>
275 <xsl:template match="m:set">
276 <xsl:param name="current_indent" select="0"/>
277 <xsl:param name="width" select="$framewidth"/>
278 <xsl:variable name="uri" select="@definitionURL"/>
279 <!-- <xsl:value-of select="concat(string($absPath), @definitionURL)"/>
282 <xsl:when test="count(child::*) = 0">
283 <xsl:call-template name="mksymbol">
284 <xsl:with-param name="symbol" select="'emptyset'"/>
288 <xsl:variable name="charlength">
289 <xsl:apply-templates select="." mode="charcount"/>
292 <xsl:when test="$charlength > $framewidth">
294 <xsl:when test="name(*[1]) = 'm:bvar'">
295 <xsl:text>{</xsl:text>
296 <xsl:apply-templates select="m:bvar/m:ci"/>
297 <xsl:text>:</xsl:text>
298 <xsl:apply-templates select="m:bvar/m:type">
299 <xsl:with-param name="current_indent"
300 select="$current_indent + 2 + string-length(m:bvar/m:ci)"/>
301 </xsl:apply-templates><BR/>
302 <xsl:call-template name="make_indent">
303 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
305 <xsl:text>|</xsl:text>
306 <xsl:apply-templates select="m:condition">
307 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
308 </xsl:apply-templates>
309 <xsl:text>}</xsl:text>
312 <xsl:text>{</xsl:text>
313 <xsl:apply-templates select="*[position()=1]">
314 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
315 </xsl:apply-templates>
316 <xsl:for-each select="*[position()>1]">
317 <xsl:text>,</xsl:text>
319 <xsl:call-template name="make_indent">
320 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
322 <xsl:apply-templates select=".">
323 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
324 </xsl:apply-templates>
326 <xsl:text>}</xsl:text>
331 <xsl:apply-templates mode="inline" select="."/>
339 <xsl:template match="m:apply[m:card]">
340 <xsl:param name="current_indent" select="0"/>
341 <xsl:param name="width" select="$framewidth"/>
342 <xsl:variable name="uri">
343 <xsl:value-of select="m:card/@definitionURL"/>
345 <xsl:text>|</xsl:text>
346 <xsl:apply-templates select="*[2]">
347 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
348 </xsl:apply-templates>
349 <xsl:text>|</xsl:text>
354 <xsl:template match="m:in|m:notin|m:intersect|m:union
355 |m:subset|m:prsubset|m:setdiff|m:card" mode="charcount">
356 <xsl:param name="incurrent_length" select="0"/>
358 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
359 <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>
361 <xsl:when test="string($siblength) = """>
362 <xsl:value-of select="$incurrent_length + string-length()"/>
365 <xsl:value-of select="number($siblength)"/>
370 <xsl:value-of select="$incurrent_length + string-length()"/>