[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Aw: Which is less expensive group by or select di

Subject: Re: Aw: Which is less expensive group by or select distinct-values
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 15 Jul 2016 20:18:18 -0000
Re: Aw:  Which is less expensive group by or select  di
On 15.07.2016 22:12, 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>

Or directly with perform-sort.

Like this:

		<xsl:value-of separator=",">
			<xsl:perform-sort select="distinct-values(.//term[not(@keyref)])">
				<xsl:sort select="."></xsl:sort>

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.