[Home] [By Thread] [By Date] [Recent Entries]
Thanks, but I figured it out. In case people are interested...what I meant was this: In my example I have 12 items (both make and model nodes) and so three columns should be 4 each. I don' t want to break up a make node though so the actually output groups them into columns of 5, 4 and 3. Having 4 items in each column would cause the "accord" to in a different column then the rest of the hondas. Same with the tundra/toyotas. Is that more clear? The solution I came up with is the following snippit. I am new to XML and XSLT so if anyone sees any potential problems or knows a better way (maybe without iterating through all the cars three times...) with this please let me know. It seems to work well though for me. -Jesse <xsl:variable name="total" select="count(./make) + count(./make/model)"/> <div style="float: left; width:33%;"> <ul> <xsl:for-each select="./make"> <xsl:if test="count(preceding-sibling::*)+count(preceding-sibling::*/model) < ($total div 3)"> <li class="make"> <xsl:value-of select="@name" /> </li> <xsl:for-each select="./model"> <li class="model"> <xsl:value-of select="." /> </li> </xsl:for-each> </xsl:if> </xsl:for-each> </ul> </div> <div style="float: left; width:33%;"> <ul> <xsl:for-each select="./make"> <xsl:if test="(count(preceding-sibling::*)+count(preceding-sibling::*/model) > ($total div 3)) and (count(preceding-sibling::*)+count(preceding-sibling::*/model) < ($total div 3)*2)"> <li class="make"> <xsl:value-of select="@name" /> </li> <xsl:for-each select="./model"> <li class="model"> <xsl:value-of select="." /> </li> </xsl:for-each> </xsl:if> </xsl:for-each> </ul> </div> <div style="float: left; width:33%;"> <ul> <xsl:for-each select="./make"> <xsl:if test="count(preceding-sibling::*)+count(preceding-sibling::*/model) > ($total div 3)*2"> <li class="make"> <xsl:value-of select="@name" /> </li> <xsl:for-each select="./model"> <li class="model"> <xsl:value-of select="." /> </li> </xsl:for-each> </xsl:if> </xsl:for-each> </ul> </div>
On 4/5/07, Nathan Young -X (natyoung - Artizen at Cisco) <natyoung@c...> wrote: Hi. -- ____________________________ jessem@c... B.S. Computer Science University of California Santa Barbara
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |

Cart



