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 <!-- **************************************************************** -->
42 <xsl:template mode="inline" match="m:apply[m:limit]">
43 <xsl:variable name="uri">
44 <xsl:value-of select="m:limit/@definitionURL"/>
47 <xsl:attribute name="href">
48 <xsl:value-of select="concat(string($header),string($uri))"/>
50 <xsl:text>lim</xsl:text>
53 <xsl:apply-templates select="m:bvar/m:ci"/>
54 <FONT FACE="symbol" mathcolor="blue">®</FONT>
55 <xsl:apply-templates mode="inline" select="m:lowlimit"/>
57 <xsl:apply-templates mode="inline" select="*[4]"/>
60 <!-- DIFFERENTIATION -->
62 <xsl:template mode="inline" match="m:apply[m:diff]">
63 <xsl:variable name="uri">
64 <xsl:value-of select="m:diff/@definitionURL"/>
67 <xsl:attribute name="href">
68 <xsl:value-of select="concat(string($header),string($uri))"/>
71 <xsl:text>/</xsl:text>
73 <xsl:text>d</xsl:text>
74 <xsl:value-of select="m:bvar/m:ci"/>
77 <xsl:apply-templates mode="inline" select="*[3]"/>
80 <!-- ABSOLUTE VALUE -->
81 <xsl:template mode="inline" match="m:apply[m:abs]">
82 <xsl:variable name="uri">
83 <xsl:value-of select="m:abs/@definitionURL"/>
85 <xsl:text>|</xsl:text>
86 <xsl:apply-templates mode="inline" select="*[2]"/>
87 <xsl:text>|</xsl:text>
92 <xsl:template mode="inline" match="m:apply[m:fact]">
93 <xsl:variable name="uri">
94 <xsl:value-of select="m:abs/@definitionURL"/>
96 <xsl:apply-templates mode="inline" select="*[2]"/>
97 <xsl:text>!</xsl:text>
102 <xsl:template match="m:apply[m:root]">
103 <xsl:variable name="uri">
104 <xsl:value-of select="m:abs/@definitionURL"/>
106 <xsl:text>(sqr</xsl:text>
107 <xsl:apply-templates mode="inline" select="*[2]"/>
108 <xsl:text>)</xsl:text>
113 <xsl:template mode="inline" match="m:apply[m:power]">
114 <xsl:variable name="uri">
115 <xsl:value-of select="m:power/@definitionURL"/>
117 <xsl:apply-templates mode="inline" select="*[2]"/>
119 <xsl:apply-templates mode="inline" select="*[3]"/>
123 <!-- MIN and MAX (binari: estendere) -->
125 <xsl:template mode="inline" match="m:apply[m:min|m:max]">
126 <xsl:variable name="uri">
127 <xsl:value-of select="*[1]/@definitionURL"/>
129 <xsl:variable name="symbol">
131 <xsl:when test="m:min">
132 <xsl:value-of select="'min'"/>
134 <xsl:when test="m:max">
135 <xsl:value-of select="'max'"/>
140 <xsl:attribute name="href">
141 <xsl:value-of select="concat(string($header),string($uri))"/>
143 <xsl:value-of select="$symbol"/>
145 <xsl:text>{</xsl:text>
146 <xsl:apply-templates mode="inline" select="*[2]"/>
147 <xsl:text>, </xsl:text>
148 <xsl:apply-templates mode="inline" select="*[3]"/>
149 <xsl:text>}</xsl:text>
152 <!-- **************************************************************** -->
153 <!-- COUNTING MODE -->
154 <!-- **************************************************************** -->
157 <xsl:template match="m:apply[m:limit]">
158 <xsl:param name="current_indent" select="0"/>
159 <xsl:param name="width" select="$framewidth"/>
160 <xsl:variable name="uri">
161 <xsl:value-of select="m:limit/@definitionURL"/>
163 <xsl:variable name="charlength">
164 <xsl:apply-templates select="m:limit" mode="charcount"/>
167 <xsl:when test="$charlength > $framewidth">
169 <xsl:attribute name="href">
170 <xsl:value-of select="concat(string($header),string($uri))"/>
172 <xsl:text>lim</xsl:text>
175 <xsl:apply-templates select="m:bvar/m:ci"/>
176 <FONT FACE="symbol" mathcolor="blue">®</FONT>
177 <xsl:apply-templates select="m:lowlimit"/>
180 <xsl:call-template name="make_indent">
181 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
183 <xsl:apply-templates select="*[4]">
184 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
185 </xsl:apply-templates>
188 <xsl:apply-templates mode="inline" select="."/>
193 <!-- DIFFERENTIATION -->
194 <xsl:template match="m:apply[m:diff]">
195 <xsl:param name="current_indent" select="0"/>
196 <xsl:param name="width" select="$framewidth"/>
197 <xsl:variable name="uri">
198 <xsl:value-of select="m:diff/@definitionURL"/>
201 <xsl:attribute name="href">
202 <xsl:value-of select="concat(string($header),string($uri))"/>
205 <xsl:text>/</xsl:text>
207 <xsl:text>d</xsl:text>
208 <xsl:value-of select="m:bvar/m:ci"/>
211 <xsl:apply-templates select="*[3]">
212 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
213 </xsl:apply-templates>
217 <!-- ABSOLUTE VALUE -->
218 <xsl:template match="m:apply[m:abs]">
219 <xsl:param name="current_indent" select="0"/>
220 <xsl:param name="width" select="$framewidth"/>
221 <xsl:variable name="uri">
222 <xsl:value-of select="m:abs/@definitionURL"/>
224 <xsl:text>|</xsl:text>
225 <xsl:apply-templates select="*[2]">
226 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
227 </xsl:apply-templates>
228 <xsl:text>|</xsl:text>
233 <xsl:template match="m:apply[m:fact]">
234 <xsl:param name="current_indent" select="0"/>
235 <xsl:param name="width" select="$framewidth"/>
236 <xsl:variable name="uri">
237 <xsl:value-of select="m:abs/@definitionURL"/>
239 <xsl:apply-templates select="*[2]">
240 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
241 </xsl:apply-templates>
242 <xsl:text>!</xsl:text>
247 <xsl:template match="m:apply[m:root]">
248 <xsl:param name="current_indent" select="0"/>
249 <xsl:param name="width" select="$framewidth"/>
250 <xsl:variable name="uri">
251 <xsl:value-of select="m:abs/@definitionURL"/>
253 <xsl:text>(sqr</xsl:text>
254 <xsl:apply-templates select="*[2]">
255 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
256 </xsl:apply-templates>
257 <xsl:text>)</xsl:text>
262 <xsl:template match="m:apply[m:power]">
263 <xsl:param name="current_indent" select="0"/>
264 <xsl:param name="width" select="$framewidth"/>
265 <xsl:variable name="uri">
266 <xsl:value-of select="m:power/@definitionURL"/>
268 <xsl:apply-templates select="*[2]"/>
270 <xsl:apply-templates select="*[3]"/>
274 <!-- MIN and MAX (binari: estendere) -->
276 <xsl:template match="m:apply[m:min|m:max]">
277 <xsl:param name="current_indent" select="0"/>
278 <xsl:param name="width" select="$framewidth"/>
279 <xsl:variable name="uri">
280 <xsl:value-of select="*[1]/@definitionURL"/>
282 <xsl:variable name="charlength">
283 <xsl:apply-templates select="*[1]" mode="charcount"/>
285 <xsl:variable name="symbol">
287 <xsl:when test="m:min">
288 <xsl:value-of select="'min'"/>
290 <xsl:when test="m:max">
291 <xsl:value-of select="'max'"/>
296 <xsl:when test="$charlength > $framewidth">
298 <xsl:attribute name="href">
299 <xsl:value-of select="concat(string($header),string($uri))"/>
301 <xsl:value-of select="$symbol"/>
303 <xsl:text>{</xsl:text>
304 <xsl:apply-templates select="*[2]">
305 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
306 </xsl:apply-templates>
307 <xsl:text>,</xsl:text>
309 <xsl:call-template name="make_indent">
310 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
312 <xsl:apply-templates select="*[3]">
313 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
314 </xsl:apply-templates>
315 <xsl:text>}</xsl:text>
318 <xsl:apply-templates mode="inline" select="."/>
325 <xsl:template match="m:abs|m:fact|m:root
326 |m:limit|m:diff|m:min|m:max" mode="charcount">
327 <xsl:param name="incurrent_length" select="0"/>
329 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
330 <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>
332 <xsl:when test="string($siblength) = """>
333 <xsl:value-of select="$incurrent_length + string-length()"/>
336 <xsl:value-of select="number($siblength)"/>
341 <xsl:value-of select="$incurrent_length + string-length()"/>