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:limit]">
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:limit/@definitionURL"/>
43 <xsl:variable name="charlength">
44 <xsl:apply-templates select="m:limit" mode="charcount"/>
47 <xsl:when test="$charlength > $framewidth">
49 <xsl:attribute name="href">
50 <xsl:value-of select="concat(string($header),string($uri))"/>
52 <xsl:text>lim</xsl:text>
55 <xsl:apply-templates select="m:bvar/m:ci"/>
56 <FONT FACE="symbol" mathcolor="blue">®</FONT>
57 <xsl:apply-templates select="m:lowlimit"/>
60 <xsl:call-template name="make_indent">
61 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
63 <xsl:apply-templates select="*[4]">
64 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
65 </xsl:apply-templates>
69 <xsl:attribute name="href">
70 <xsl:value-of select="concat(string($header),string($uri))"/>
72 <xsl:text>lim</xsl:text>
75 <xsl:apply-templates select="m:bvar/m:ci"/>
76 <FONT FACE="symbol" mathcolor="blue">®</FONT>
77 <xsl:apply-templates select="m:lowlimit"/>
79 <xsl:apply-templates select="*[4]">
80 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
81 </xsl:apply-templates>
86 <!-- DIFFERENTIATION -->
88 <xsl:template match="m:apply[m:diff]">
89 <xsl:param name="current_indent" select="0"/>
90 <xsl:param name="width" select="$framewidth"/>
91 <xsl:variable name="uri">
92 <xsl:value-of select="m:diff/@definitionURL"/>
95 <xsl:attribute name="href">
96 <xsl:value-of select="concat(string($header),string($uri))"/>
99 <xsl:text>/</xsl:text>
101 <xsl:text>d</xsl:text>
102 <xsl:value-of select="m:bvar/m:ci"/>
105 <xsl:apply-templates select="*[3]">
106 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
107 </xsl:apply-templates>
110 <!-- ABSOLUTE VALUE -->
111 <xsl:template match="m:apply[m:abs]">
112 <xsl:param name="current_indent" select="0"/>
113 <xsl:param name="width" select="$framewidth"/>
114 <xsl:variable name="uri">
115 <xsl:value-of select="m:abs/@definitionURL"/>
117 <xsl:text>|</xsl:text>
118 <xsl:apply-templates select="*[2]">
119 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
120 </xsl:apply-templates>
121 <xsl:text>|</xsl:text>
126 <xsl:template match="m:apply[m:fact]">
127 <xsl:param name="current_indent" select="0"/>
128 <xsl:param name="width" select="$framewidth"/>
129 <xsl:variable name="uri">
130 <xsl:value-of select="m:abs/@definitionURL"/>
132 <xsl:apply-templates select="*[2]">
133 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
134 </xsl:apply-templates>
135 <xsl:text>!</xsl:text>
140 <xsl:template match="m:apply[m:root]">
141 <xsl:param name="current_indent" select="0"/>
142 <xsl:param name="width" select="$framewidth"/>
143 <xsl:variable name="uri">
144 <xsl:value-of select="m:abs/@definitionURL"/>
146 <xsl:text>(sqr</xsl:text>
147 <xsl:apply-templates select="*[2]">
148 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
149 </xsl:apply-templates>
150 <xsl:text>)</xsl:text>
155 <xsl:template match="m:apply[m:power]">
156 <xsl:param name="current_indent" select="0"/>
157 <xsl:param name="width" select="$framewidth"/>
158 <xsl:variable name="uri">
159 <xsl:value-of select="m:power/@definitionURL"/>
161 <xsl:apply-templates select="*[2]"/>
163 <xsl:apply-templates select="*[3]"/>
167 <!-- MIN and MAX (binari: estendere) -->
169 <xsl:template match="m:apply[m:min|m:max]">
170 <xsl:param name="current_indent" select="0"/>
171 <xsl:param name="width" select="$framewidth"/>
172 <xsl:variable name="uri">
173 <xsl:value-of select="*[1]/@definitionURL"/>
175 <xsl:variable name="charlength">
176 <xsl:apply-templates select="*[1]" mode="charcount"/>
178 <xsl:variable name="symbol">
180 <xsl:when test="m:min">
181 <xsl:value-of select="'min'"/>
183 <xsl:when test="m:max">
184 <xsl:value-of select="'max'"/>
189 <xsl:when test="$charlength > $framewidth">
191 <xsl:attribute name="href">
192 <xsl:value-of select="concat(string($header),string($uri))"/>
194 <xsl:value-of select="$symbol"/>
196 <xsl:text>{</xsl:text>
197 <xsl:apply-templates select="*[2]">
198 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
199 </xsl:apply-templates>
200 <xsl:text>,</xsl:text>
202 <xsl:call-template name="make_indent">
203 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
205 <xsl:apply-templates select="*[3]">
206 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
207 </xsl:apply-templates>
208 <xsl:text>}</xsl:text>
212 <xsl:attribute name="href">
213 <xsl:value-of select="concat(string($header),string($uri))"/>
215 <xsl:value-of select="$symbol"/>
217 <xsl:text>{</xsl:text>
218 <xsl:apply-templates select="*[2]"/>
219 <xsl:text>, </xsl:text>
220 <xsl:apply-templates select="*[3]"/>
221 <xsl:text>}</xsl:text>
228 <xsl:template match="m:abs|m:fact|m:root
229 |m:limit|m:diff|m:min|m:max" mode="charcount">
230 <xsl:param name="incurrent_length" select="0"/>
232 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
233 <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>
235 <xsl:when test="string($siblength) = """>
236 <xsl:value-of select="$incurrent_length + string-length()"/>
239 <xsl:value-of select="number($siblength)"/>
244 <xsl:value-of select="$incurrent_length + string-length()"/>