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

Re: Eliminating duplicates while processing

Subject: Re: Eliminating duplicates while processing
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 13 Nov 2002 11:16:44 -0500
xslt eliminating duplicates
José Carlos--

This is best accomplished by using two passes: first sort, then de-duplicate on the sorted order. The two passes can be combined in a single stylesheet if you're willing to use a node-set() extension function to turn a result tree fragment (the sorted node set bound to a variable, say) into a true node set (so it can be traversed).

In XSLT 2.0 the need for the extension function will go away.

In general, since XSLT processing is declarative, functional and side-effect-free, you don't have access to information about what's processed when. In fact, strictly speaking you shouldn't -- XSLT specifies how the output should be arranged, but doesn't specify in what order the processor does anything.

Cheers,
Wendell

At 06:56 AM 11/13/2002, you wrote:
Hi all, I am having the following problem:

I want to process a list of nodes that can appear at several different
points of the structure, and I ant to process them in a particular order.
This is easy to specify:

        for-each select="//node-name"
            sort select="criteria"

The problem is that I want to supress the node's processing if it is equal
to the one that precedes it in that order. How can I have access to the last
processed node while processing the current one?

TIA
jcr


======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


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-2013 All Rights Reserved.