[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|