Subject: Re: [xsl] counting element characters From: Florent Georges <lists@xxxxxxxxxxxx> Date: Mon, 11 Aug 2008 09:42:59 +0200 (CEST) |
Dimitre Novatchev wrote: Hi > <xsl:template match="a"> > <xsl:variable name="c" as="text()*"> > <xsl:for-each select="descendant::p"> > <xsl:value-of select="string-length(.)"/> > </xsl:for-each> > </xsl:variable> > <xsl:value-of select="sum($c)"/> > </xsl:template> Which can be spelled as following, in order to prevent creating useless text nodes: <xsl:template match="a"> <xsl:value-of select="sum(.//p/string-length(.))"/> </xsl:template> Regards, --drkm _____________________________________________________________________________ Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] counting element characte, Dimitre Novatchev | Thread | Re: [xsl] counting element characte, Dimitre Novatchev |
[xsl] RE: user functions with varia, Tony Nassar | Date | Re: [xsl] counting element characte, Andrew Welch |
Month |