[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Incrementing a Global variable
> > Though the issue about incrementing the variables has > been discussed a lot on this list, I feel if there is > a feature where some sort of variable incrmenting is > possible in XSLT, it will save lot of programming > hours producing a trivial thing as generating serial > nos. I am not suggesting to deviate from the viewpoint > that XSLT should be a functional language. But it would deviate from that principle. It would change it from a functional language to a procedural one, in which instructions have to be executed in a fixed order. > Also if we can have looping constructs > which can iterate over number ranges for e.g. > > for (int i=0; i < n; i++) , it will facilitate > processing loops in a diffrent way. XSLT 2.0 allows you to do this: <xsl:for-each select="20 to 30"> <xsl:value-of select="."/> </xsl:for-each> You can simulate this in 1.0 with <xsl:for-each select="//node()[position() <= 10]"> <xsl:value-of select="position() + 20"/> </xsl:for-each> Michael Kay XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|