xsl-list
[Top] [All Lists]

Re: [xsl] distinct-values

2008-09-24 07:10:42
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/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>