Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Ignore Repetition

Hi All,

I have the following XML

<mydata>
<category name='category1'>
<subcategory>sub1</subcategory>
<subcategory>sub2</subcategory>
<subcategory>sub3</subcategory>
</category>
<category name='category2>
<subcategory>sub4</subcategory>
<subcategory>sub1</subcategory>
<subcategory>sub5</subcategory>
</category>
</mydata>

Here, the subcategory sub1 is occuring in more than one category.
Now I am using the following XSL to put all the subcategory names in a dropdown
box

<select>
<xsl:for-each select='//category/subcategory'>
<option> <xsl:value-of select='.' /></option>
</xsl:for-each>
</select>

This results in the repition of sub1 in the dropdown box. I want to take
only unique subcategories in the dropdown box.
I have tried to use javascript to stop it but it is not working in netscape.
Can any body suggest what should I do.
Thanks in advance.

Manish
[1187 byte] By [Manish Gupta] at [2007-11-9 14:55:17]