[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSL:key and Column grouping
Hi David,
Yes, you're almost there. In order to use key() as flexibly as you need to, you have to "back out" a bit. Try modifying this bit of code: <xsl:for-each select="key('map', mapunits/maps)[position() mod 3 = 1]"> <tr valign="top" style="width:100%"> <xsl:apply-templates select=".|following-sibling::maps[position() < 3]"/> </tr> </xsl:for-each> to read something like: <xsl:variable name="key-value" select="mapunits/maps"/> <xsl:for-each select="key('map', $key-value)"> <xsl:if select="position() mod 3 = 1"> <xsl:variable name="pos" select="position()"/> <tr valign="top" style="width:100%"> <xsl:apply-templates select=". | key('map', $key-value)[$pos+1] | key('map', $key-value)[$pos+2]"/> <!-- and maybe you'll want code here to provide blank cells when you don't have exact multiples of three --> </tr> </xsl:if> </xsl:for-each> I hope it's more or less self-explanatory.... Cheers, Wendell
|
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
|