|
Subject: [xsl] Sum in conjunction with string splitting? From: Steve <subsume@xxxxxxxxx> Date: Fri, 8 Sep 2006 12:55:39 -0400 |
The snippet below attempts to split the string 'mileage 6' into [mileage] and [6] and then store it in $miles (for example).
I am trying to get the SUM of the resulting SPLIT of the nodes that match 'mileage'.
<xsl:variable name="miles">
<xsl:call-template name="str-split-to-words">
<xsl:with-param name="pStr"
select="msxsl:node-set($expenses[substring(expense,1,7)='mileage']/expense)"
/>
<xsl:with-param name="pDelimiters" select="' '" />
<!-- splitting expense at blank spaces -->
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="msxsl:node-set($miles)/*[2]" /><br /><Expenses> <expense>Mileage 6</expense> <expense>cheese</expense> (wouldn't match) <expense>Mileage 10</expense> </Expenses>
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Numbering selected output seq, Mark Wilson | Thread | Re: [xsl] Sum in conjunction with s, Dimitre Novatchev |
| Re: [xsl] Relationships in for-each, Bob Portnell | Date | Re: [xsl] Relationships in for-each, Bob Portnell |
| Month |