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

Increment of a variable

Subject: Increment of a variable
From: Regine Vergon <regine_vergon@xxxxxxxxx>
Date: Wed, 23 Feb 2000 05:43:14 -0800 (PST)
xsl variable increment
Hi,

I have defined a xsl variable which contain the length of current string and i
want to increment this variable after that with length of the next string. 
I need to select only a certain amount a characters to be printed.
How do i do that ?

1)My xml doc look like
...
<TextBlock>
  <Text num=1>string 1 </text>
  <Text num=2>string 2 </text>
</TextBlock>
...


2)My xsl stylesheet (not working !!!)

  ...
  <xsl:template match="TextBlock"> 
    <xsl:variable name="total">0</xsl:variable>

    <xsl:for-each select="*">
    
       <xsl:variable name="NbBytes">
         <xsl:value-of select="string-length(.)"/>
       </xsl:variable>
    
       <xsl:variable name="total">
         <xsl:value-of select="number($length) + number($total)"/>
       </xsl:variable>

       if the total is > 3000 then select substring...

       <xsl:value-of select="."></xsl:value-of>

    </xsl:for-each>
  </xsl:template>
  ...


Thanks
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com


 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.