This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Selecting unique value of an attribute [ restated and tested solution :)]
- To: xsl-list at mulberrytech dot com
- Subject: Re: Selecting unique value of an attribute [ restated and tested solution :)]
- From: Miloslav Nic <nicmila at idoox dot com>
- Date: Wed, 23 Aug 2000 17:18:10 +0200
- References: <200008231400.QAA13857@mail.informatik.hu-berlin.de>
- Reply-To: xsl-list at mulberrytech dot com
I promise I will not send example after 30 sec thinking in the future.
I would have eaten the mail if it was on a paper to punish myself
but fortunately we are in the age of e-mails and hard drives are too
hard to swallow.
I will restate the question in my terms :) :
Find all elements in the source and sort them alphabetically:
<xsl:template match="/">
<xsl:apply-templates select="//*">
<xsl:sort select="name()"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="*">
<xsl:if test="not(preceding::*[name()=name(current())])">
<xsl:text>
</xsl:text>
<xsl:value-of select="name()"/>
</xsl:if>
</xsl:template>
It works. I have tested it :))))))
>
> /-------------------------------------------------------------------\
> | ob|do Dipl.Inf. Oliver Becker |
> | --+-- E-Mail: obecker@informatik.hu-berlin.de |
> | op|qo WWW: http://www.informatik.hu-berlin.de/~obecker |
> \-------------------------------------------------------------------/
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
--
******************************************
<firstName> Miloslav </firstName>
<surname> Nic </surname>
<mail> nicmila@idoox.com </mail>
<support> http://www.zvon.org </support>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list