xsl-list
[Top] [All Lists]

Re: Print number of chars depending upon int value

2005-04-22 04:53:23
: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(_at_)nag(_dot_)co(_dot_)uk> 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() &lt;=
$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

________________________________________________________________________


--~------------------------------------------------------------------
XSL-List info and archive: 
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to:
http://lists.mulberrytech.com/xsl-list/
or e-mail:
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--