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

Add n number of characters to Element text

Subject: Add n number of characters to Element text
From: "Matthew Cordes" <mcorde61@xxxxxxxxx>
Date: Wed, 17 May 2000 17:49:20 -0400
n number of
Hello Ross

> I need to add n number of characters, the "0" character specifically, to
> the text of a particular element depending on the length of the element's
text.
>
> VB had a function for this called String(char, n).
> Called like this, String("0", 2) would return "00"
> I am not sure what the Java analog is.

Perl can do this as well ala ( $var .= "0" x 2; ), but in Java you probably
have to use a for loop

    String var = ""
    for( int x=0; x < 2; x++ )
            {
                 String += "0";
            }

I personally would use java and store the strings in your xml document, but
there is probably a way to do what you want in pure XSLT with a
<xsl:for-each> that would loop n times for n zeros, you could probably even
have a template that does this and takes the number of times to loop as an
<xsl:param>

Good luck.
-matt


 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.