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">
43 <xsl:value-of select="concat(string($absPath), @definitionURL)"/>
46 <xsl:when test="count(child::*) = 0">
47 <FONT FACE="symbol" 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 <xsl:attribute name="href">
126 <xsl:call-template name="makeURL">
127 <xsl:with-param name="url" select="$uri"/>
130 <FONT FACE="symbol" mathcolor="blue">
131 <xsl:value-of select="$symbol"/>
134 <xsl:apply-templates mode="inline" select="*[3]"/>
135 <xsl:text>)</xsl:text>
138 <!-- *************************************************************** -->
140 <xsl:template match="m:apply[m:in|m:notin|m:intersect|m:union
141 |m:subset|m:prsubset|m:setdiff]">
142 <xsl:param name="current_indent" select="0"/>
143 <xsl:param name="width" select="$framewidth"/>
144 <xsl:variable name="uri">
145 <xsl:value-of select="*[1]/@definitionURL"/>
147 <xsl:variable name="charlength">
148 <xsl:apply-templates select="*[1]" mode="charcount"/>
150 <xsl:variable name="symbol">
152 <xsl:when test="m:in">
153 <xsl:value-of select="'Î'"/>
155 <xsl:when test="m:notin">
156 <xsl:value-of select="'Ï'"/>
158 <xsl:when test="m:intersect">
159 <xsl:value-of select="'Ç'"/>
161 <xsl:when test="m:union">
162 <xsl:value-of select="'È'"/>
164 <xsl:when test="m:subset">
165 <xsl:value-of select="'Í'"/>
167 <xsl:when test="m:prsubset">
168 <xsl:value-of select="'Ì'"/>
170 <xsl:when test="m:setdiff">
171 <xsl:value-of select="'/'"/>
176 <xsl:when test="$charlength > $framewidth">
177 <xsl:text>(</xsl:text>
178 <xsl:apply-templates select="*[2]">
179 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
180 </xsl:apply-templates>
182 <xsl:call-template name="make_indent">
183 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
186 <xsl:attribute name="href">
187 <xsl:call-template name="makeURL">
188 <xsl:with-param name="url" select="$uri"/>
191 <FONT FACE="symbol" mathcolor="blue">
192 <xsl:value-of select="$symbol"/>
195 <xsl:apply-templates select="*[3]">
196 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
197 </xsl:apply-templates>
198 <xsl:text>)</xsl:text>
201 <xsl:apply-templates mode="inline" select="."/>
209 <xsl:template match="m:set">
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="concat(string($absPath), @definitionURL)"/>
216 <xsl:when test="count(child::*) = 0">
217 <FONT FACE="symbol" mathcolor="blue">Æ</FONT>
220 <xsl:variable name="charlength">
221 <xsl:apply-templates select="." mode="charcount"/>
224 <xsl:when test="$charlength > $framewidth">
226 <xsl:when test="name(*[1]) = 'm:bvar'">
227 <xsl:text>{</xsl:text>
228 <xsl:apply-templates select="m:bvar/m:ci"/>
229 <xsl:text>:</xsl:text>
230 <xsl:apply-templates select="m:bvar/m:type">
231 <xsl:with-param name="current_indent"
232 select="$current_indent + 2 + string-length(m:bvar/m:ci)"/>
233 </xsl:apply-templates><BR/>
234 <xsl:call-template name="make_indent">
235 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
237 <xsl:text>|</xsl:text>
238 <xsl:apply-templates select="m:condition">
239 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
240 </xsl:apply-templates>
241 <xsl:text>}</xsl:text>
244 <xsl:text>{</xsl:text>
245 <xsl:apply-templates select="*[position()=1]">
246 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
247 </xsl:apply-templates>
248 <xsl:for-each select="*[position()>1]">
249 <xsl:text>,</xsl:text>
251 <xsl:call-template name="make_indent">
252 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
254 <xsl:apply-templates select=".">
255 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
256 </xsl:apply-templates>
258 <xsl:text>}</xsl:text>
263 <xsl:apply-templates mode="inline" select="."/>
271 <xsl:template match="m:apply[m:card]">
272 <xsl:param name="current_indent" select="0"/>
273 <xsl:param name="width" select="$framewidth"/>
274 <xsl:variable name="uri">
275 <xsl:value-of select="m:card/@definitionURL"/>
277 <xsl:text>|</xsl:text>
278 <xsl:apply-templates select="*[2]">
279 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
280 </xsl:apply-templates>
281 <xsl:text>|</xsl:text>
286 <xsl:template match="m:in|m:notin|m:intersect|m:union
287 |m:subset|m:prsubset|m:setdiff|m:card" mode="charcount">
288 <xsl:param name="incurrent_length" select="0"/>
290 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
291 <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>
293 <xsl:when test="string($siblength) = """>
294 <xsl:value-of select="$incurrent_length + string-length()"/>
297 <xsl:value-of select="number($siblength)"/>
302 <xsl:value-of select="$incurrent_length + string-length()"/>