Changeset 8035189c for stylesheets/pdf
- Timestamp:
- 07/30/2006 07:05:14 PM (18 years ago)
- Children:
- 76f695d
- Parents:
- e6a5a46
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
stylesheets/pdf/lfs-mixed.xsl
re6a5a46 r8035189c 17 17 <xsl:template match="para"> 18 18 <xsl:choose> 19 <xsl:when test="child::ulink[@url=' ']"/> 19 20 <xsl:when test="./@remap='verbatim'"> 20 21 <fo:block wrap-option="no-wrap" … … 255 256 </xsl:template> 256 257 258 <!-- Total packages size calculation --> 259 <xsl:template match="returnvalue"> 260 <xsl:call-template name="calculation"> 261 <xsl:with-param name="scope" select="../../variablelist"/> 262 </xsl:call-template> 263 </xsl:template> 264 265 <xsl:template name="calculation"> 266 <xsl:param name="scope"/> 267 <xsl:param name="total">0</xsl:param> 268 <xsl:param name="position">1</xsl:param> 269 <xsl:variable name="tokens" select="count($scope/varlistentry)"/> 270 <xsl:variable name="token" select="$scope/varlistentry[$position]/term/token"/> 271 <xsl:variable name="size" select="substring-before($token,' KB')"/> 272 <xsl:variable name="rawsize"> 273 <xsl:choose> 274 <xsl:when test="contains($size,',')"> 275 <xsl:value-of select="concat(substring-before($size,','),substring-after($size,','))"/> 276 </xsl:when> 277 <xsl:otherwise> 278 <xsl:value-of select="$size"/> 279 </xsl:otherwise> 280 </xsl:choose> 281 </xsl:variable> 282 <xsl:choose> 283 <xsl:when test="$position <= $tokens"> 284 <xsl:call-template name="calculation"> 285 <xsl:with-param name="scope" select="$scope"/> 286 <xsl:with-param name="position" select="$position +1"/> 287 <xsl:with-param name="total" select="$total + $rawsize"/> 288 </xsl:call-template> 289 </xsl:when> 290 <xsl:otherwise> 291 <xsl:choose> 292 <xsl:when test="$total < '1000'"> 293 <xsl:value-of select="$total"/> 294 <xsl:text> KB</xsl:text> 295 </xsl:when> 296 <xsl:when test="$total > '1000' and $total < '5000'"> 297 <xsl:value-of select="substring($total,1,1)"/> 298 <xsl:text>,</xsl:text> 299 <xsl:value-of select="substring($total,2)"/> 300 <xsl:text> KB</xsl:text> 301 </xsl:when> 302 <xsl:otherwise> 303 <xsl:value-of select="round($total div 1024)"/> 304 <xsl:text> MB</xsl:text> 305 </xsl:otherwise> 306 </xsl:choose> 307 </xsl:otherwise> 308 </xsl:choose> 309 </xsl:template> 310 257 311 </xsl:stylesheet>
Note:
See TracChangeset
for help on using the changeset viewer.