[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: string-length of all label attributes

Subject: Re: string-length of all label attributes
From: George Cristian Bina <george@xxxxxxx>
Date: Thu, 08 Jul 2004 13:10:15 +0300
xsl string length
> You need to write a recursive template that goes throught the nodes in the node-set and sums the string-lengths, or if you're using XPath 2.0, then something in the lines of sum(for $i in //@label return string-length($i)).


Or you can get all the labels inside a variable and get the length of that variable:


    <xsl:template match="/">
        <xsl:variable name="labels">
            <xsl:for-each select="//@label">
                <xsl:value-of select="."/>
            </xsl:for-each>
        </xsl:variable>
        <xsl:value-of select="string-length($labels)"/>
    </xsl:template>

Hope that helps,
George
-----------------------------------------------
George Cristian Bina
<oXygen/> XML Editor & XSLT Editor/Debugger
http://www.oxygenxml.com

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.