Subject: [xsl] Re: XPath to calculate total of attribute values From: Lee Goddard <home@xxxxxxxxxxxxxx> Date: Thu, 10 Jan 2002 16:40:20 +0100 |
count(./TR/TD[1]) + sum(./TR/TD[1]/@COLSPAN|./TR/TD[1]/@ROWSPAN) - count (./TR/TD[1]/@COLSPAN|./TR/TD[1]/@ROWSPAN)
1. On encountering a TABLE element, 2. examine the first child (guaranteed to be a TR element): 3. count the number of TD elements within the TR (guaranteed the only content), 4. and add to that count the value of every attribute named COLSPAN.
<xsl:template match="TABLE"> COUNT 1 [ <xsl:value-of select="count(./TR/TD)"/> ] </xsl:template>
I can't figure out how to write an XPath expression to calculate a total of all the TD/@COLSPANs....
Worst yet, I've just moved to Hungary and left Mike Kay's book in London (what was I thinking?)
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Re: XPath to calculate total , Lee Goddard | Thread | [xsl] Full support for EXSLT funct:, Petr Cimprich |
Re: [xsl] use cases for d-o-e, Joerg Pietschmann | Date | Re: [xsl] Re: XPath to calculate to, Lee Goddard |
Month |