summaryrefslogtreecommitdiff
path: root/tests/exslt/date/sum.2.xsl
blob: 642fafeeebae5e973bf6458ace27a6ca031dca2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" 
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:date="http://exslt.org/dates-and-times"
                extension-element-prefixes="date">

<xsl:output method="text"/>
<xsl:strip-space elements="*"/>

<xsl:template match="sum">
sum    : <xsl:apply-templates select="date"/>
result : <xsl:value-of select="date:sum(date/@dur)"/>
</xsl:template>

<xsl:template match="date">
  <xsl:if test="position() != 1"> + </xsl:if>
  <xsl:value-of select="@dur"/>
</xsl:template>

</xsl:stylesheet>