[xsl] Sorting, but then splitting into 5 <ul> columns

Subject: [xsl] Sorting, but then splitting into 5 <ul> columns
From: "Dan Acuff" <dacuff@xxxxxxxxxxxxxx>
Date: Wed, 6 Aug 2008 09:35:54 -0400
I have figured out how to sort based on an attribute value.

But so far I can only get 1 UL list, and I really need to use the
columnCount variable to make 5 <UL> lists, that we will then float left.

Is there a way to do this possibly by using the results of the first
category template and processing it in a new template?

    <xsl:param name="paraCatagory"/>
    <xsl:param name="altRowBGColor"/>

    <xsl:template match="menu">
        <xsl:apply-templates
select="descendant::category[@name=$paraCatagory]"/>
    </xsl:template>

    <xsl:template match="category">
        <xsl:variable name="modelCount" select="count(category)"/>
        <xsl:variable name="columnCount" select="round($modelCount div
5) +1"/>
        <ul>
            <xsl:for-each select="child::category">
                <xsl:sort data-type="text" order="ascending"
select="@display_name"/>
                <xsl:choose>
                    <xsl:when test="position() mod 2 = 0">
                        <li
style="background-color:{$altRowBGColor};"><!-- Set this color in
includes/code/category_vb.asp -->
                            <a href="{descendant::link}">
                                <xsl:value-of select="@display_name"/>
                            </a>
                        </li>
                    </xsl:when>
                    <xsl:otherwise>
                        <li>
                            <a href="{descendant::link}">
                                <xsl:value-of select="@display_name"/>
                            </a>
                        </li>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:for-each>
        </ul>
    </xsl:template>
</xsl:stylesheet>


Thank you,
Dan

~~~~~~~~~~~~~~~~~~
Dan Acuff
Developer
SureSource, Inc.
203.922.7546
dacuff@xxxxxxxxxxxxxx
~~~~~~~~~~~~~~~~~~

Current Thread