3 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:m="http://www.w3.org/1998/Math/MathML">
6 <!--***********************************************************************-->
7 <!-- INIT style for HTML -->
8 <!-- HELM Group: Asperti, Padovani, Sacerdoti, Schena -->
9 <!--***********************************************************************-->
11 <xsl:variable name="absPath">http://localhost:8081/getciconly?uri=</xsl:variable>
15 <xsl:template match="m:apply[m:limit]">
16 <xsl:param name="current_indent" select="0"/>
17 <xsl:param name="width" select="$framewidth"/>
18 <xsl:variable name="uri">
19 <xsl:value-of select="m:limit/@definitionURL"/>
21 <xsl:variable name="charlength">
22 <xsl:apply-templates select="m:limit" mode="charcount"/>
25 <xsl:when test="$charlength > $framewidth">
27 <xsl:attribute name="href">
28 <xsl:value-of select="concat(string($header),string($uri))"/>
30 <xsl:text>lim</xsl:text>
33 <xsl:apply-templates select="m:bvar/m:ci"/>
34 <FONT FACE="symbol" color="blue">®</FONT>
35 <xsl:apply-templates select="m:lowlimit"/>
38 <xsl:call-template name="make_indent">
39 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
41 <xsl:apply-templates select="*[4]">
42 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
43 </xsl:apply-templates>
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" color="blue">®</FONT>
55 <xsl:apply-templates select="m:lowlimit"/>
57 <xsl:apply-templates select="*[4]">
58 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
59 </xsl:apply-templates>
64 <!-- DIFFERENTIATION -->
66 <xsl:template match="m:apply[m:diff]">
67 <xsl:param name="current_indent" select="0"/>
68 <xsl:param name="width" select="$framewidth"/>
69 <xsl:variable name="uri">
70 <xsl:value-of select="m:diff/@definitionURL"/>
73 <xsl:attribute name="href">
74 <xsl:value-of select="concat(string($header),string($uri))"/>
77 <xsl:text>/</xsl:text>
79 <xsl:text>d</xsl:text>
80 <xsl:value-of select="m:bvar/m:ci"/>
83 <xsl:apply-templates select="*[3]">
84 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
85 </xsl:apply-templates>
88 <!-- ABSOLUTE VALUE -->
89 <xsl:template match="m:apply[m:abs]">
90 <xsl:param name="current_indent" select="0"/>
91 <xsl:param name="width" select="$framewidth"/>
92 <xsl:variable name="uri">
93 <xsl:value-of select="m:abs/@definitionURL"/>
95 <xsl:text>|</xsl:text>
96 <xsl:apply-templates select="*[2]">
97 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
98 </xsl:apply-templates>
99 <xsl:text>|</xsl:text>
104 <xsl:template match="m:apply[m:fact]">
105 <xsl:param name="current_indent" select="0"/>
106 <xsl:param name="width" select="$framewidth"/>
107 <xsl:variable name="uri">
108 <xsl:value-of select="m:abs/@definitionURL"/>
110 <xsl:apply-templates select="*[2]">
111 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
112 </xsl:apply-templates>
113 <xsl:text>!</xsl:text>
118 <xsl:template match="m:apply[m:root]">
119 <xsl:param name="current_indent" select="0"/>
120 <xsl:param name="width" select="$framewidth"/>
121 <xsl:variable name="uri">
122 <xsl:value-of select="m:abs/@definitionURL"/>
124 <xsl:text>(sqr</xsl:text>
125 <xsl:apply-templates select="*[2]">
126 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
127 </xsl:apply-templates>
128 <xsl:text>)</xsl:text>
133 <xsl:template match="m:apply[m:power]">
134 <xsl:param name="current_indent" select="0"/>
135 <xsl:param name="width" select="$framewidth"/>
136 <xsl:variable name="uri">
137 <xsl:value-of select="m:power/@definitionURL"/>
139 <xsl:apply-templates select="*[2]"/>
141 <xsl:apply-templates select="*[3]"/>
145 <!-- MIN and MAX (binari: estendere) -->
147 <xsl:template match="m:apply[m:min|m:max]">
148 <xsl:param name="current_indent" select="0"/>
149 <xsl:param name="width" select="$framewidth"/>
150 <xsl:variable name="uri">
151 <xsl:value-of select="*[1]/@definitionURL"/>
153 <xsl:variable name="charlength">
154 <xsl:apply-templates select="*[1]" mode="charcount"/>
156 <xsl:variable name="symbol">
158 <xsl:when test="m:min">
159 <xsl:value-of select="'min'"/>
161 <xsl:when test="m:max">
162 <xsl:value-of select="'max'"/>
167 <xsl:when test="$charlength > $framewidth">
169 <xsl:attribute name="href">
170 <xsl:value-of select="concat(string($header),string($uri))"/>
172 <xsl:value-of select="$symbol"/>
174 <xsl:text>{</xsl:text>
175 <xsl:apply-templates select="*[2]">
176 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
177 </xsl:apply-templates>
178 <xsl:text>,</xsl:text>
180 <xsl:call-template name="make_indent">
181 <xsl:with-param name="current_indent" select="$current_indent + 5"/>
183 <xsl:apply-templates select="*[3]">
184 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
185 </xsl:apply-templates>
186 <xsl:text>}</xsl:text>
190 <xsl:attribute name="href">
191 <xsl:value-of select="concat(string($header),string($uri))"/>
193 <xsl:value-of select="$symbol"/>
195 <xsl:text>{</xsl:text>
196 <xsl:apply-templates select="*[2]"/>
197 <xsl:text>, </xsl:text>
198 <xsl:apply-templates select="*[3]"/>
199 <xsl:text>}</xsl:text>
206 <xsl:template match="m:abs|m:fact|m:root
207 |m:limit|m:diff|m:min|m:max" mode="charcount">
208 <xsl:param name="incurrent_length" select="0"/>
210 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
211 <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>
213 <xsl:when test="string($siblength) = """>
214 <xsl:value-of select="$incurrent_length + string-length()"/>
217 <xsl:value-of select="number($siblength)"/>
222 <xsl:value-of select="$incurrent_length + string-length()"/>