xsl-list
[Top] [All Lists]

How do I get a SUM of the string-length of all child nodes ??

2005-05-26 23:36:26
I am not sure how to do this:

here is what I have which is obviously incorrect:

<xsl:template match="/*/*/*" >                                        
  <xsl:param name="rcnt" />                                           
  <xsl:choose>                                                        
  <xsl:when test="position()=1">                                      
    <xsl:variable name="csum" select="sum(string-length(.))"/>        
rsizes <xsl:value-of select="$rcnt"/> =<xsl:value-of select="$csum"/>;
  </xsl:when>                                                         
  <xsl:otherwise>                                                     
  bt('<td align="center"> ');                                         
  bt('<xsl:value-of select="."/> ');                                  
  bt('</td> ');                                                       
  </xsl:otherwise>                                                    
  </xsl:choose>                                                       
</xsl:template>                                                       

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--