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

Re: How to pad space to a text node to make it have specfic

Subject: Re: How to pad space to a text node to make it have specfic length?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 18 Oct 2000 11:50:37 GMT
xslt padding spaces
> 
> 
> Thank you very much.
> 
> I can use string-length() to find the needed no of spaces to pad.
> However, since there is not for-loop or while-loop like-element in XSLT,
> I cannot easily use concat() to form a fixed-length data.
> 
> Any suggestion how to do that.
>  

What do you want to do with the data????
The answer I gave appears to do what you asked for, eg

<xsl:variable name="x">
<xsl:value-of select="substring(
'                                      ',
string-length(xxxx))"/>
<xsl:value-of select="xxxx"/>
</xsl:variable>

makes $x the text of xxx padded to length 38 with spaces.

You don't need to use any loop do you? If you did, I'm not sure what you
mean by
> since there is not for-loop or while-loop like-element in XSLT,
as loops are just a simple case of recursion, and XSLT has the more
general recursive functionality, doesn't it?

David


 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.