[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] distinct-values


Subject: Re: [xsl] distinct-values
From: Martin Honnen <Martin.Honnen@xxxxxx>
Date: Wed, 24 Sep 2008 13:08:47 +0200

Madlik, Monika (LNG-VIE) wrote:

How is it possible, to create a list of distinct values? I tried to use
distinct-values() but without any result.

That should work as follows:


<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="2.0">

<xsl:output method="xml" indent="yes"/>

<xsl:template match="ReferenceList">
<absatz>
<xsl:for-each select="distinct-values(SourceList/Link/@ref | TargetList/Link/@ref)">
<Link ref="{.}"/>
</xsl:for-each>
</absatz>
</xsl:template>


</xsl:stylesheet>

assuming you use an XSLT 2.0 processor like Saxon 9 or Gestalt or AltovaXML tools.


--


	Martin Honnen
	http://JavaScript.FAQTs.com/


Current Thread
Keywords