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

Re: Print number of chars depending upon int value

Subject: Re: Print number of chars depending upon int value
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Fri, 22 Apr 2005 22:28:01 +1000
printing number lists
This reminds me of a submission to xsl-list in 2001:

"An efficient repeat() template (Was: RE: Re: RE: creating a string of
repeated charactors)"

     http://www.biglist.com/lists/xsl-list/archives/200107/msg01040.html


So, we have an example of efficient and scalable solution of this
problem for very big N.


Cheers,
Dimitre Novatchev.


On 4/22/05, Ranjan K. Baisak <ranjanbaisak@xxxxxxxxx> wrote:
> :D David, I am quite agree with you.
> This is an instance where I have mentioned keeping eye
> with other functions/constructs available in XSLT2.0
> I really did not count how many exact lines would be
> there :(
>
> -Ranjan
> --- David Carlisle <davidc@xxxxxxxxx> wrote:
> >
> > > Should not there be an alternative for any
> > function in
> > > xslt2.0 in xslt 1.0.
> >
> > No, of course not.
> > What would be the difference between (xslt1 + xslt1
> > versions of all
> > xslt2 features) and xslt2.
> >
> > This is not specific to xslt, for any language, if a
> > new feature is
> > added in a new version, it's not available in the
> > old one.
> >
> > > Otherwise it is required to write 100 lines of
> > code as
> > > mentioned by Eliot Harold.
> >
> >
> > In this case it's not 100's of lines. Unless your
> > padding needs to be
> > really long (ie nore characters than there are nodes
> > in your stylesheet)
> > then you can do
> >
> > <xsl:for-each
> > select="(document('')//node())[position() <=
> > $count]">.</xsl:for-each>
> >
> > if you want to do a fully general recursive loop
> > then something like
> >
> > <xsl:template name="x">
> >  <xsl:param name="n"/>
> >   <xsl:if test="$n!=0">.<xsl:call-template name="x">
> >      <xsl:with-param name="n" select="$n - 1"/>
> >      </xsl:call-template>
> >   </xsl:if>
> > </xsl:template>
> >
> > which is 7 lines, 3 of which are just closing open
> > elements so it's
> > really only 3 lines of code.
> >
> > David
> >
> >
> ________________________________________________________________________
> > This e-mail has been scanned for all viruses by
> > Star. The
> > service is powered by MessageLabs. For more
> > information on a proactive
> > anti-virus service working around the clock, around
> > the globe, visit:
> > http://www.star.net.uk
> >
> ________________________________________________________________________
> >
> >
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com

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.