Re: Aw: [xsl] Which is less expensive group by or select distinct-values

Subject: Re: Aw: [xsl] Which is less expensive group by or select distinct-values
From: "Dan Vint dvint@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 16 Jul 2016 00:33:52 -0000
Ok so that is yet another variation. My question was more about using distinct-value or the for-each-group to do the selection and which might be faster or less costly.

..dan

At 01:12 PM 7/15/2016, Martin Honnen martin.honnen@xxxxxx wrote:
On 15.07.2016 21:39, dvint dvint@xxxxxxxxx wrote:
I need a formated and sorted string

Yes, I understand, but the result of distinct-values() can be sorted directly with e.g



<data type="topicreport" name="WDTermList"> <xsl:for-each select="distinct-values(.//term[not(@keyref)])"> <xsl:sort select="." /> <xsl:value-of select="."/> <xsl:if test="position() != last()">, </xsl:if> </xsl:for-each> </data>

or if you want a variable with e.g.

<xsl:variable name="TermList" select="distinct-values(.//term[not(@keyref)])" />

<data type="topicreport" name="WDTermList">
  <xsl:for-each select="$TermList">
        <xsl:sort select="." />
        <xsl:value-of select="."/>
         <xsl:if test="position() != last()">, </xsl:if>
   </xsl:for-each>
</data>



Or directly with perform-sort.


--------------------------------------------------------------------------- Danny Vint

Panoramic Photography
http://www.dvint.com

voice: 619-647-5780

Current Thread