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

RE: String-length

Subject: RE: String-length
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Mon, 13 Dec 1999 15:37:43 -0000
length track xsl
You need another of those recursive named templates that does, in effect
strlength($nodeset) = string-length($nodeset[1]) +
strlength($nodeset[position()>1])

Of course writing this in XSL is about 15 lines of code. There are many
examples of this pattern in the archives of this list.

Mike Kay

> -----Original Message-----
> From: Thomas Karlsen [mailto:ThomasK@xxxxxxxxxxxxxxx]
> Sent: 13 December 1999 11:22
> To: 'XSL-List@xxxxxxxxxxxxxxxx'
> Subject: String-length
> 
> 
> Im trying to hold track over how many char. i'm sending to the output.
> 
> xml:
> <section>
>  <para>this is a test</para>
>  <para>this is a test</para>
>  <para>this is a test</para>
>  <para>this is a test</para>
> </section>
> 
> xsl:
> <template match="section">
>  <apply-templates />
> </template>
> 
> <template match="para">
>  This para contains: <xsl:value-of select="string-length()"/>
>  Total from para number 1 to <xsl:value-of select="position()"/>:
> <xsl:value-of select="string-length(preceding-sibling::para)"/>
>  <apply-templates />
> </template>
> 
> My question is how can I add the string-values for the para's that is
> already traversed?
> The preceding-sibling function only gives me the value of the 
> first para in
> the node-set.
> 
> Please help
> 
> __ Thomas Karlsen | System Developer
> __ Cell Network ASA | New Media Science | Sørkedalsveien 10A, 
> N-0304 Oslo,
> Norway
>     Tel: +47 23196600 | Fax: +47 23196601 | Mob: +47 91514293
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.