Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 5th, 2013, 06:40 AM
Registered User
 
Join Date: Aug 2013
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default display numbers till a given range using xslt for-each

please help me to loop through start and end using xslt 2.0

This is what I tried, but I got the following error:
Expected token 'eof' found 'NAME'. $start -->to <--$end

XSLT:

<xsl:param name="start" select="1"/>
<xsl:variable name="end" select="10/>
<xsl:variable name="from" select="$start"/>
<xsl:variable name="to" select="$end"/>
<xsl:for-each select="$start to $end">
<p>
<xsl:value-of select="$start"/>
</p>
</xsl:for-each>
 
Old August 5th, 2013, 06:45 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You are writing valid XSLT 2.0 code, and then passing it to an XSLT 1.0 processor.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old August 5th, 2013, 07:08 AM
Registered User
 
Join Date: Aug 2013
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default need help

Quote:
Originally Posted by mhkay View Post
You are writing valid XSLT 2.0 code, and then passing it to an XSLT 1.0 processor.

Can you explain what is wrong here in the above given code ?
 
Old August 5th, 2013, 07:59 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Sorry you didn't understand my message. There is nothing wrong with the code. But the error message shows that the XSLT processor doesn't understand XSLT 2.0 code. It's like passing valid C code to a Java processor, you will get error messages: they don't mean there's anything wrong with the code, they mean you are processing it incorrectly.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Summing large numbers in xslt mrkensr XSLT 4 January 5th, 2013 11:53 AM
range expressions in xslt 2.0 tkuzzy XSLT 1 December 22nd, 2011 02:40 PM
Available numbers not in a range mickhughes Oracle 1 March 5th, 2009 05:05 AM
how to generate random numbers in xslt anboss XSLT 3 July 23rd, 2008 09:10 AM
Query Help - Display numbers from two Months rkellogg Access 2 September 27th, 2006 08:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.