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

Re: Expanding Ranges

Subject: Re: Expanding Ranges
From: Mukul Gandhi <gandhi.mukul@xxxxxxxxx>
Date: Fri, 20 Mar 2009 21:38:07 +0530
Re:  Expanding Ranges
On Fri, Mar 20, 2009 at 12:13 PM, Ganesh Babu N <nbabuganesh@xxxxxxxxx>
wrote:
> <xsl:variable name="start"
> select="number(substring-after(cr[1]/@refid,'MEPRfig'))"/>
> <xsl:variable name="end"
> select="number(substring-after(cr[last()]/@refid,'MEPRfig'))"/>
> <xsl:value-of select="for $i in $start to $end return concat('fig', $i)"/>
>
> These are my expressions.
>
> It shows the following error as:
>
> B XPTY0004: Required item type of first operand of 'to' is xs:integer;
> supplied value has
> B item type xs:double.
>
> How to resolve this. the values are 2 and 3.

The return type of function 'number' is, xs:double (ref:
http://www.w3.org/TR/xpath-functions/#func-number).

To use an expression like, for $i in $start to $end -- $start and $end
must be xs:integer 's at runtime.

you can use something like, xs:integer(substring-after ... (ref:
http://www.w3.org/TR/xpath20/#id-constructor-functions).


--
Regards,
Mukul Gandhi

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.