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

RE: Re: RE: creating a string of repeated charactors

Subject: RE: Re: RE: creating a string of repeated charactors
From: "Tim Watts" <timw@xxxxxxx>
Date: Tue, 17 Jul 2001 11:12:43 +1000
cheers charactors
Thanks Dimitre,

for the more terse code.

Unfortumatly I do not know the max value (N) so the code won't be usefull
for me this time.

Also, just one small error in the code... the select in

<xsl:variable name="maxString" select="*************"/>
should be
<xsl:variable name="maxString" select="'*************'"/>
---------------------------------------^-------------^

or it is going to look for an element called *************

Cheers,

Tim ;)

-----Original Message-----
From: Dimitre Novatchev

Tim Watts wrote:

[snip]

> The EXSLT function <xsl:value-of select="str:padding(10, '*')" /> function
> is the sort of thing I hoped might exist in *standard* XSLT.
>
> Since there isn't I'll use the template that you pointed me to instead.
> (Thanks for saving me from writing it! :) )
>
> I was hoping that there might me a less verbose way of doing what really
is
> quite a simple task.

This template is "verbose" by necessity -- it solves the ***general*** case,
when
neither the filling characters, nor an upper limit for the length are known
in
advance.

It is also quite space-consuming (and time) -- because the string length is
doubled
until a larger string is constructed, this will use twice as much memory, as
necessary for the resulting string.

In many cases one knows in advance that he'll only need a string of upto N
characters.

[snip]

Cheers,
Dimitre Novatchev.


 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.