[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] XSLT 1.0 newbie: sum of selected elements


Subject: RE: [xsl] XSLT 1.0 newbie: sum of selected elements
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 11 Dec 2006 14:23:43 -0000

Is't possible, for this example, elements with @id 
> 2 or 3 to be selected first and after to be summarized @due 
> and/or @init?
> 

Yes, that's what variables are for. 

<xsl:variable name="selectedNodes" select=".... the nodes ..."/>
<xsl:value-of select="sum($selectedNodes/@due)"/>

Michael Kay
http://www.saxonica.com/


Current Thread