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:variable name="absPath">http://localhost:8081/getciconly?uri=</xsl:variable>
39 <xsl:template match="m:apply[m:limit]">
40 <xsl:param name="current_indent" select="0"/>
41 <xsl:param name="width" select="$framewidth"/>
42 <xsl:variable name="uri">
43 <xsl:value-of select="m:limit/@definitionURL"/>
45 <xsl:variable name="charlength">
46 <xsl:apply-templates select="m:limit" mode="charcount"/>
49 <xsl:when test="$charlength > $framewidth">
51 <xsl:attribute name="href">
52 <xsl:value-of select="concat(string($header),string($uri))"/>
54 <xsl:text>lim</xsl:text>
57 <xsl:apply-templates select="m:bvar/m:ci"/>
58 <FONT FACE="symbol" mathcolor="blue">®</FONT>
59 <xsl:apply-templates select="m:lowlimit"/>
62 <xsl:call-template name="make_indent">
63 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
65 <xsl:apply-templates select="*[4]">
66 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
67 </xsl:apply-templates>
71 <xsl:attribute name="href">
72 <xsl:value-of select="concat(string($header),string($uri))"/>
74 <xsl:text>lim</xsl:text>
77 <xsl:apply-templates select="m:bvar/m:ci"/>
78 <FONT FACE="symbol" mathcolor="blue">®</FONT>
79 <xsl:apply-templates select="m:lowlimit"/>
81 <xsl:apply-templates select="*[4]">
82 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
83 </xsl:apply-templates>
88 <!-- DIFFERENTIATION -->
90 <xsl:template match="m:apply[m:diff]">
91 <xsl:param name="current_indent" select="0"/>
92 <xsl:param name="width" select="$framewidth"/>
93 <xsl:variable name="uri">
94 <xsl:value-of select="m:diff/@definitionURL"/>
97 <xsl:attribute name="href">
98 <xsl:value-of select="concat(string($header),string($uri))"/>
101 <xsl:text>/</xsl:text>
103 <xsl:text>d</xsl:text>
104 <xsl:value-of select="m:bvar/m:ci"/>
107 <xsl:apply-templates select="*[3]">
108 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
109 </xsl:apply-templates>
112 <!-- ABSOLUTE VALUE -->
113 <xsl:template match="m:apply[m:abs]">
114 <xsl:param name="current_indent" select="0"/>
115 <xsl:param name="width" select="$framewidth"/>
116 <xsl:variable name="uri">
117 <xsl:value-of select="m:abs/@definitionURL"/>
119 <xsl:text>|</xsl:text>
120 <xsl:apply-templates select="*[2]">
121 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
122 </xsl:apply-templates>
123 <xsl:text>|</xsl:text>
128 <xsl:template match="m:apply[m:fact]">
129 <xsl:param name="current_indent" select="0"/>
130 <xsl:param name="width" select="$framewidth"/>
131 <xsl:variable name="uri">
132 <xsl:value-of select="m:abs/@definitionURL"/>
134 <xsl:apply-templates select="*[2]">
135 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
136 </xsl:apply-templates>
137 <xsl:text>!</xsl:text>
142 <xsl:template match="m:apply[m:root]">
143 <xsl:param name="current_indent" select="0"/>
144 <xsl:param name="width" select="$framewidth"/>
145 <xsl:variable name="uri">
146 <xsl:value-of select="m:abs/@definitionURL"/>
148 <xsl:text>(sqr</xsl:text>
149 <xsl:apply-templates select="*[2]">
150 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
151 </xsl:apply-templates>
152 <xsl:text>)</xsl:text>
157 <xsl:template match="m:apply[m:power]">
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:power/@definitionURL"/>
163 <xsl:apply-templates select="*[2]"/>
165 <xsl:apply-templates select="*[3]"/>
169 <!-- MIN and MAX (binari: estendere) -->
171 <xsl:template match="m:apply[m:min|m:max]">
172 <xsl:param name="current_indent" select="0"/>
173 <xsl:param name="width" select="$framewidth"/>
174 <xsl:variable name="uri">
175 <xsl:value-of select="*[1]/@definitionURL"/>
177 <xsl:variable name="charlength">
178 <xsl:apply-templates select="*[1]" mode="charcount"/>
180 <xsl:variable name="symbol">
182 <xsl:when test="m:min">
183 <xsl:value-of select="'min'"/>
185 <xsl:when test="m:max">
186 <xsl:value-of select="'max'"/>
191 <xsl:when test="$charlength > $framewidth">
193 <xsl:attribute name="href">
194 <xsl:value-of select="concat(string($header),string($uri))"/>
196 <xsl:value-of select="$symbol"/>
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>
202 <xsl:text>,</xsl:text>
204 <xsl:call-template name="make_indent">
205 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
207 <xsl:apply-templates select="*[3]">
208 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
209 </xsl:apply-templates>
210 <xsl:text>}</xsl:text>
214 <xsl:attribute name="href">
215 <xsl:value-of select="concat(string($header),string($uri))"/>
217 <xsl:value-of select="$symbol"/>
219 <xsl:text>{</xsl:text>
220 <xsl:apply-templates select="*[2]"/>
221 <xsl:text>, </xsl:text>
222 <xsl:apply-templates select="*[3]"/>
223 <xsl:text>}</xsl:text>
230 <xsl:template match="m:abs|m:fact|m:root
231 |m:limit|m:diff|m:min|m:max" mode="charcount">
232 <xsl:param name="incurrent_length" select="0"/>
234 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
235 <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>
237 <xsl:when test="string($siblength) = """>
238 <xsl:value-of select="$incurrent_length + string-length()"/>
241 <xsl:value-of select="number($siblength)"/>
246 <xsl:value-of select="$incurrent_length + string-length()"/>