Changeset 3815390 for stylesheets/xhtml
- Timestamp:
- May 13, 2006, 11:52:09 AM (19 years ago)
- Children:
- 6f2e018
- Parents:
- 3f072de
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
stylesheets/xhtml/lfs-mixed.xsl
r3f072de r3815390 267 267 </xsl:template> 268 268 269 <!-- Total packages size calculation --> 270 <xsl:template match="returnvalue"> 271 <xsl:call-template name="calculation"> 272 <xsl:with-param name="scope" select="../../variablelist"/> 273 </xsl:call-template> 274 </xsl:template> 275 276 <xsl:template name="calculation"> 277 <xsl:param name="scope"/> 278 <xsl:param name="total">0</xsl:param> 279 <xsl:param name="position">1</xsl:param> 280 <xsl:variable name="tokens" select="count($scope/varlistentry)"/> 281 <xsl:variable name="token" select="$scope/varlistentry[$position]/term/token"/> 282 <xsl:variable name="size" select="substring-before($token,' KB')"/> 283 <xsl:variable name="rawsize"> 284 <xsl:choose> 285 <xsl:when test="contains($size,',')"> 286 <xsl:value-of select="concat(substring-before($size,','),substring-after($size,','))"/> 287 </xsl:when> 288 <xsl:otherwise> 289 <xsl:value-of select="$size"/> 290 </xsl:otherwise> 291 </xsl:choose> 292 </xsl:variable> 293 <xsl:choose> 294 <xsl:when test="$position <= $tokens"> 295 <xsl:call-template name="calculation"> 296 <xsl:with-param name="scope" select="$scope"/> 297 <xsl:with-param name="position" select="$position +1"/> 298 <xsl:with-param name="total" select="$total + $rawsize"/> 299 </xsl:call-template> 300 </xsl:when> 301 <xsl:otherwise> 302 <xsl:choose> 303 <xsl:when test="$total < '1000'"> 304 <xsl:value-of select="$total"/> 305 <xsl:text> KB</xsl:text> 306 </xsl:when> 307 <xsl:when test="$total > '1000' and $total < '5000'"> 308 <xsl:value-of select="substring($total,1,1)"/> 309 <xsl:text>,</xsl:text> 310 <xsl:value-of select="substring($total,2)"/> 311 <xsl:text> KB</xsl:text> 312 </xsl:when> 313 <xsl:otherwise> 314 <xsl:value-of select="round($total div 1024)"/> 315 <xsl:text> MB</xsl:text> 316 </xsl:otherwise> 317 </xsl:choose> 318 </xsl:otherwise> 319 </xsl:choose> 320 </xsl:template> 321 269 322 </xsl:stylesheet>
Note:
See TracChangeset
for help on using the changeset viewer.