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/get?url=</xsl:variable>
14 <!-- BASIC OPERATORS -->
16 <xsl:template match="m:apply[m:and|m:or|m:eq|m:neq|m:leq|m:lt
17 |m:geq|m:gt|m:plus|m:times]">
18 <xsl:param name="current_indent" select="0"/>
19 <xsl:param name="width" select="$framewidth"/>
20 <xsl:variable name="uri">
21 <xsl:value-of select="*[1]/@definitionURL"/>
23 <xsl:variable name="charlength">
24 <xsl:apply-templates select="*[1]" mode="charcount"/>
26 <xsl:variable name="symbol">
28 <xsl:when test="m:and">
29 <xsl:value-of select="'Ù'"/>
31 <xsl:when test="m:or">
32 <xsl:value-of select="'Ú'"/>
34 <xsl:when test="m:eq">
35 <xsl:value-of select="'='"/>
37 <xsl:when test="m:neq">
38 <xsl:value-of select="'¹'"/>
40 <xsl:when test="m:leq">
41 <xsl:value-of select="'£'"/>
43 <xsl:when test="m:lt">
44 <xsl:value-of select="'<'"/>
46 <xsl:when test="m:geq">
47 <xsl:value-of select="'³'"/>
49 <xsl:when test="m:gt">
50 <xsl:value-of select="'>'"/>
52 <xsl:when test="m:plus">
53 <xsl:value-of select="'+'"/>
55 <xsl:when test="m:times">
56 <xsl:value-of select="'*'"/>
61 <xsl:when test="$charlength > $framewidth">
62 <xsl:text>(</xsl:text>
63 <xsl:apply-templates select="*[2]">
64 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
65 </xsl:apply-templates>
67 <xsl:call-template name="make_indent">
68 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
71 <xsl:attribute name="href">
72 <xsl:value-of select="concat(string($header),string($uri))"/>
74 <FONT FACE="symbol" color="blue">
75 <xsl:value-of select="$symbol"/>
78 <xsl:apply-templates select="*[3]">
79 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
80 </xsl:apply-templates>
81 <xsl:text>)</xsl:text>
84 <xsl:text>(</xsl:text>
85 <xsl:apply-templates select="*[2]"/>
87 <xsl:attribute name="href">
88 <xsl:value-of select="concat(string($header),string($uri))"/>
90 <FONT FACE="symbol" color="blue">
91 <xsl:value-of select="$symbol"/>
94 <xsl:apply-templates select="*[3]"/>
95 <xsl:text>)</xsl:text>
100 <!-- MINUS (can be unary!) -->
102 <xsl:template match="m:apply[m:minus]">
103 <xsl:param name="current_indent" select="0"/>
104 <xsl:param name="width" select="$framewidth"/>
105 <xsl:variable name="uri">
106 <xsl:value-of select="*[1]/@definitionURL"/>
109 <xsl:when test="count(child::*)=2">
111 <xsl:attribute name="href">
112 <xsl:value-of select="concat(string($header),string($uri))"/>
114 <xsl:text>-</xsl:text>
116 <xsl:apply-templates select="*[2]">
117 <xsl:with-param name="current_indent" select="$current_indent + 1"/>
118 </xsl:apply-templates>
121 <xsl:variable name="charlength">
122 <xsl:apply-templates select="*[1]" mode="charcount"/>
125 <xsl:when test="$charlength > $framewidth">
126 <xsl:text>(</xsl:text>
127 <xsl:apply-templates select="*[2]">
128 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
129 </xsl:apply-templates>
131 <xsl:call-template name="make_indent">
132 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
135 <xsl:attribute name="href">
136 <xsl:value-of select="concat(string($header),string($uri))"/>
138 <xsl:text>-</xsl:text>
140 <xsl:apply-templates select="*[3]">
141 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
142 </xsl:apply-templates>
143 <xsl:text>)</xsl:text>
146 <xsl:text>(</xsl:text>
147 <xsl:apply-templates select="*[2]"/>
149 <xsl:attribute name="href">
150 <xsl:value-of select="concat(string($header),string($uri))"/>
152 <xsl:text>-</xsl:text>
154 <xsl:apply-templates select="*[3]"/>
155 <xsl:text>)</xsl:text>
164 <xsl:template match="m:apply[m:not]">
165 <xsl:param name="current_indent" select="0"/>
166 <xsl:param name="width" select="$framewidth"/>
167 <xsl:variable name="uri">
168 <xsl:value-of select="m:not/@definitionURL"/>
171 <xsl:attribute name="href">
172 <xsl:value-of select="concat(string($header),string($uri))"/>
174 <FONT FACE="symbol" color="blue">Ø</FONT>
176 <xsl:apply-templates select="*[2]"/>
181 <xsl:template match="m:apply[m:exists]">
182 <xsl:param name="current_indent" select="0"/>
183 <xsl:param name="width" select="$framewidth"/>
184 <xsl:variable name="uri">
185 <xsl:value-of select="m:exists/@definitionURL"/>
187 <xsl:variable name="charlength">
188 <xsl:apply-templates select="m:exists" mode="charcount"/>
191 <xsl:when test="$charlength > $framewidth">
193 <xsl:attribute name="href">
194 <xsl:value-of select="concat(string($header),string($uri))"/>
196 <FONT FACE="symbol" color="blue">$</FONT>
198 <xsl:apply-templates select="m:bvar/m:ci"/>
199 <xsl:text>:</xsl:text>
200 <xsl:apply-templates select="m:condition">
201 <xsl:with-param name="current_indent" select="$current_indent + 2 +
202 string-length(bvar/ci)"/>
203 </xsl:apply-templates>
205 <xsl:call-template name="make_indent">
206 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
208 <xsl:text>.</xsl:text>
209 <xsl:apply-templates select="*[last()]">
210 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
211 </xsl:apply-templates>
215 <xsl:attribute name="href">
216 <xsl:value-of select="concat(string($header),string($uri))"/>
218 <FONT FACE="symbol" color="blue">$</FONT>
220 <xsl:apply-templates select="m:bvar/m:ci"/>
221 <xsl:text>:</xsl:text>
222 <xsl:apply-templates select="m:condition"/>
223 <xsl:text>.</xsl:text>
224 <xsl:apply-templates select="*[last()]">
225 <xsl:with-param name="current_indent" select="$current_indent + 2"/>
226 </xsl:apply-templates>
236 <xsl:template match="m:cn|m:and|m:or|m:not|m:exists|m:eq|m:neq
237 |m:lt|m:leq|m:gt|m:geq|m:plus|m:minus|m:times" mode="charcount">
238 <xsl:param name="incurrent_length" select="0"/>
240 <xsl:when test="$framewidth >= ($incurrent_length + string-length())">
241 <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>
243 <xsl:when test="string($siblength) = """>
244 <xsl:value-of select="$incurrent_length + string-length()"/>
247 <xsl:value-of select="number($siblength)"/>
252 <xsl:value-of select="$incurrent_length + string-length()"/>