Avoiding duplicates in the node selection

Subject: Avoiding duplicates in the node selection
From: "Max Rubinstein" <mrubinst@xxxxxxxxxxx>
Date: Wed, 28 Jun 2000 08:49:06 CDT

I have the following XML source:

	<Resource URL="http://www.aspindustry.org/";>
		<Keywords> <ASP/> <SB/> </Keywords>
	<Resource URL="http://www.aspnews.com/";>
		<Keywords> <ASP/> </Keywords>
	<Resource URL="http://msdn.microsoft.com/wmi.asp";>
		<Keywords> <WMI/> </Keywords>

As you may notice, the same keyword may appear under different resources. My goal is to produce a list of keywords, sorted alphabetically, with no duplicates, to populate the HTML list with options.

This is the XSL I came up with:

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
<xsl:template match="/">
<xsl:for-each select="//Keywords/node()">
<xsl:sort select="name()" order="ascending"/>
<xsl:attribute name="value"><xsl:value-of select="name()"/></xsl:attribute>
<xsl:value-of select="name()"/>

It works, but I get duplicate entries as a result. I would like to figure out how to remove duplicate keywords.

Thanks for any help,


________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list

Current Thread