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

Re: designing a xsl:uniq function

Subject: Re: designing a xsl:uniq function
From: tcn@xxxxxxxxxxxxx (Trevor Nash)
Date: Tue, 04 Sep 2001 12:28:22 GMT
xslt uniq
On Tue, 04 Sep 2001 13:17:49 +0100, Paul Terray wrote:

>Hello,
>
>I recently went through some code I wrote for a 3 levels index, and I was 
>very unproud of the result. My main problem is that I need to have a uniq 
>value for my elements. Is there a way to cleanly design a template that 
>would isolate an element, just like the xsl:sort works (a XSL equivalent to 
>the UNIX uniq utility) ?
>
>Perhaps a new command for XSLT 2.0 ? It would look like :
>
><xsl:for-each select="//indexentry[@level1=$my_first_level and @level2]">
>         <xsl:sort select="@level2"/>
>         <xsl:uniq select="@level2"/>
>[...]
></xsl:for-each>
>
>What do you think of it ?

This seems to be just one case of the more general set of problems
under the heading 'grouping'.  While you are waiting for XSLT 2.0, you
might like to look at Saxon's attempt, the extension elements 'group'
and 'item'.  I have used saxon:group for exactly the case you
describe, and its very neat.

Regards,
Trevor Nash
--
Traditional training & distance learning,
Consultancy by email

Melvaig Software Engineering Limited
voice:     +44 (0) 1445 771 271 
email:     tcn@xxxxxxxxxxxxx

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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-2011 All Rights Reserved.