Here's a snippet from a XSL stylesheet that I believe does what you want. We
use it to generate an index from <indexitem> elements embedded in specific
topics (records). The index entries may or may not be unique, but we want to
list each only once, regardless. The stylesheet is specific to our DTD, of
course, but you should be able to glean the general structure.
<xsl:variable name="text" select="@text"/>
<!--the following test is only true once for each
key, even though all elements are visited by the for-each-->
<xsl:if test="not( preceding::indexitem[@text=$text]
<!--reselect only nodes with current primary key-->
From: Wim Van hoorde [mailto:[log in to unmask]]
Sent: Tuesday, October 24, 2000 5:05 AM
To: [log in to unmask]
Subject: Unique tags
Is it possible in XSL or XML to specify that each tag in the search result
has te be unique.
For example : you have a file where the same cars appear several times. Can
you get each car once from the datafile ?
cfr. the select distinct in SQL
Wim Van hoorde
Access 40 - Gossetlaan 54
1702 Groot-Bijgaarden - BELGIUM
Tel.: +32 2 467 34 30
Fax: +32 2 467 34 39
Visit our website at www.mediagenix.com
This e-mail and any files attached with it are confidential and intended
only for the use of the individual(s) or entity to whom they are addressed.
If you have received this e-mail by error, please, notify the sender