[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Assistance with the Muenchian method
Hi Garrel, > <xsl:template match="userData"> > <xsl:for-each > select="publish/website[generate-id()=generate-id(key('groups-by-wid', > @wid)[1])]"> > <xsl:sort select="@path"/> > <xsl:variable name="wid" select="@wid"/> > <xsl:for-each select="key('groups-by-wid', $wid)"> > <xsl:variable name="path" select="@path"/> > <xsl:variable name="wid" select="@wid"/> > <option value="{$wid}"><xsl:value-of select="$path"/></option> > </xsl:for-each> > </xsl:for-each> > </xsl:template> In the above, you select the websites with unique wids absolutely correctly. Then you sort them, and then you collect together all the websites with the same wid and create an option for each of them. The above code is equivalent to selecting all the websites at once and sorting them by wid: <xsl:for-each select="publish/website"> <xsl:sort select="@path" /> <option value="{@wid}"><xsl:value-of select="@path" /></option> </xsl:for-each> Instead, you only want to create the option for the unique websites, so scrap the inner xsl:for-each and just do: <xsl:for-each select="publish/website [generate-id()= generate-id(key('groups-by-wid', @wid)[1])]"> <xsl:sort select="@path"/> <option value="{@wid}"><xsl:value-of select="@path"/></option> </xsl:for-each> I hope that helps, Jeni --- Jeni Tennison http://www.jenitennison.com/ 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
|