[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Expanding Ranges
On Sat, Mar 21, 2009 at 10:53 AM, Ganesh Babu N <nbabuganesh@xxxxxxxxx> wrote: > Thanks Mukul, > > I got the solution. I find it surprising if the solution I proposed works as it is. >> <xsl:value-of select="for $i in $start to $end return concat('fig', $i)"/> I suspect if this will give the desired result. If you see the grammar for a "for expression" (http://www.w3.org/TR/xpath20/#id-for-expressions), it doesn't allow something like, $x to $y (with the semantics of a range. xsl:for-each allows this). Saxon (ver, 9.1.0.2J) compiles the above for expression {for $i in $start to $end return concat('fig', $i)} fine, but gives a blank output. It seems, it considers _$start to $end_ as ExprSingle (ref: http://www.w3.org/TR/xpath20/#doc-xpath-ExprSingle). It seems to me, Saxon should give an error or a warning in this case. I feel you should use the following code, instead: <xsl:variable name="str" as="xs:string*"> <xsl:for-each select="$start to $end"> <xsl:value-of select="concat('fig', .)" /> </xsl:for-each> </xsl:variable> <xsl:value-of select="$str" /> -- 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
|