This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: How to pad space to a text node to make it have specfic length?
- To: xsl-list at mulberrytech dot com
- Subject: Re: How to pad space to a text node to make it have specfic length?
- From: David Carlisle <davidc at nag dot co dot uk>
- Date: Wed, 18 Oct 2000 11:50:37 GMT
- References: <4825697C.00393F67.00@backupsmtp.excel.com.hk>
- Reply-To: xsl-list at mulberrytech dot com
>
>
> 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