File: total.xsl

package info (click to toggle)
lib-saxon-java 6.4.4-1
  • links: PTS
  • area: contrib
  • in suites: woody
  • size: 12,252 kB
  • ctags: 7,953
  • sloc: xml: 7,801; java: 1,187; makefile: 46
file content (21 lines) | stat: -rw-r--r-- 533 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<xsl:transform
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 version="1.0"
>

<!-- This style sheet totals the prices of the books. It is designed to be used
     with the JDOMExample sample application, which adds a VALUE attribute to the data
     in books.xml before doing a transformation -->


<xsl:template match="/">

    <HTML>
    <BODY>
    <p>Total value of books in stock: <xsl:value-of 
            select="format-number(sum(//ITEM/@VALUE),'#0.00')"/></p>
    </BODY>
    </HTML>
</xsl:template>

</xsl:transform>