Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 3 of 3

Thread: grouping in xml

  1. #1
    chrismartz is offline Senior Member
    Join Date
    Apr 2010
    Posts
    339

    Default grouping in xml

    I am trying to group the following so that it will group by the word "Sets" or "Individual Colors" and only show one of each based on the variable $VariantName:

    Code:
              <xsl:template name="VariantOptions">
                <xsl:for-each select="/root/Variants/Variant">
                  <xsl:variable name="VariantName">
                    <xsl:choose>
                      <xsl:when test="contains(VariantName,'colors')">Sets</xsl:when>
                      <xsl:when test="contains(VariantName,'Set')">Sets</xsl:when>
                      <xsl:when test="contains(VariantName,'Dozen')">Individual Colors</xsl:when>
                    </xsl:choose>
                  </xsl:variable>
                  <option value="{VariantID}">
                    <xsl:value-of select="$VariantName" />
                  </option>
                </xsl:for-each>
              </xsl:template>
    Any suggestions on how to group?
    Last edited by chrismartz; 11-07-2011 at 11:55 AM.

  2. #2
    webopius is offline Senior Member
    Join Date
    Nov 2008
    Location
    London, UK
    Posts
    440

    Default

    Hi

    Did a quick Google and this link came up which may help:

    http://www.jenitennison.com/xslt/gro...muenchian.html

    Adam

  3. #3
    chrismartz is offline Senior Member
    Join Date
    Apr 2010
    Posts
    339

    Default

    Thanks webopius. It took a while but I got it figured out with that link!