[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: context-independent counter
Tobi, It works, yes, but I'm not sure that this is the way you should be doing it. I only use this when I need to do a for loop which bears no resemblance at all to the input XML... for example, drawing a grid of set size no matter what the input is. Your input has 12 list items - if you need a generic way of doing this, then position() should be enough. Try something like: <xsl:template match="/"> <svg> <xsl:for-each select="/list/li"> <rect x="{position() * 10}" y="10" width="6" height="4"/> </xsl:for-each> </svg> </xsl:template> which should do the same thing, but be completely dependant on the number of <li> elements in the input (and is a lot quicker to type *grin*). Hope this helps, Ben 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
|