Subject: Re: [xsl] Expanding Ranges From: Ganesh Babu N <nbabuganesh@xxxxxxxxx> Date: Sat, 21 Mar 2009 10:53:20 +0530 |
Thanks Mukul, I got the solution. Regards, Ganesh On Fri, Mar 20, 2009 at 9:38 PM, Mukul Gandhi <gandhi.mukul@xxxxxxxxx> wrote: > 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: >> >> XPTY0004: Required item type of first operand of 'to' is xs:integer; >> supplied value has >> 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Expanding Ranges, Mukul Gandhi | Thread | Re: [xsl] Expanding Ranges, Mukul Gandhi |
[xsl] Empty fo:block legal?, Karl Stubsjoen | Date | Re: [xsl] Expanding Ranges, Mukul Gandhi |
Month |