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

Re: Remove duplicates from a list

Subject: Re: Remove duplicates from a list
From: "Joerg Heinicke" <joerg.heinicke@xxxxxx>
Date: Tue, 29 Jan 2002 17:01:49 +0100
obx registered trademark
This is always a grouping problem. For this the best way is using the
Muenchian Method: http://www.jenitennison.com/xslt/grouping/muenchian.html.

You have to group your <OBX> by the Observation_ID:

<xsl:key name="obx" match="OBX" use="@Observation_ID"/>

<xsl:template match="tdObsResults">
    <xsl:apply-templates select="OBX[count( . | key( 'obx',
@Observation-ID)[1] ) = 1]"/>
</xsl:template>

<xsl:template match="OBX">
    <xsl:value-of select="@Observation_ID"/>
</xsl:templaet>

Regards,

Joerg

----- Original Message -----
From: "Asim Tozlu" <Tozlu@xxxxxxxxxxxxxxxxxx>
To: <XSL-List@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, January 29, 2002 4:31 PM
Subject:  Remove duplicates from a list


> Hi,
>
> i'm XSL-newbi. I have this XML:
>
> <tdObsResults>
> <OBX ObservationDT="2001-11-05T08:00:00"
> Observation_ID="1742-6"/>
> <OBX ObservationDT="2001-11-05T08:00:00"
> Observation_ID="1232-6"/>
> <OBX ObservationDT="2001-11-03T08:00:00"
> Observation_ID="1685-6"/>
> <OBX ObservationDT="2001-11-02T08:00:00"
> Observation_ID="1742-6"/>
> <OBX ObservationDT="2001-11-08T08:00:00"
> Observation_ID="1742-6"/>
> <OBX ObservationDT="2001-11-03T08:00:00"
> Observation_ID="1685-6"/>
> </tdObsResults>
>
> and i need this Result
> 1742-6
> 1232-6
> 1685-6
>
> Thanks for a Tip
>
> Asim


 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.