Re: [xsl] grouping and discarding duplicates

Subject: Re: [xsl] grouping and discarding duplicates
From: "Vasu Chakkera" <vasucv@xxxxxxxxxxx>
Date: Thu, 1 Jul 2004 17:05:57 +0100
Hi Nathan,
I cant completely write your XSL. infact I havent even looked at your XSL
What I have done will take you in the direction ...
I have written an xsl that will eliminate duplicate
with the same <obprcal:eventid> value

in other words, if there are more than one
<xcal:vevent> with the same value for <obprcal:eventid>,
then only one of them will be selected.

Following is the code...

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
01.txt" xmlns="";>
 <xsl:key match="/obprcal:top/xcal:vcalendar/xcal:vevent" name="events"
 <xsl:template match="/">
  <!-- get unioe-nodes -->
select="/obprcal:top/xcal:vcalendar/xcal:vevent[generate-id(.) =
   <xsl:sort order="ascending" data-type="number" select="obprcal:eventid"/>
   <xsl:value-of select="obprcal:eventid"/>

you can add your code here,, I have just printed the value of
obprcal:eventid, so that you see the result ..

First Run this xsl as is against your XML and see if you are happy ..

Let me know if  thaz not what you want

Hope this helps
Vasu Chak

----- Original Message ----- 
From: "Nathan Shaw" <n8_shaw@xxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, July 01, 2004 4:03 PM
Subject: [xsl] grouping and discarding duplicates

> Hi all. I have an XSLT that sorts and groups on date
> per category. However, the client has changed the
> specs and now wants multiple categories and an All
> Categories page. This means that I have to shed
> duplicate events that appear in different categories
> and group the categories for display. I have spent a
> day and a half trying to figure out how to do this
> without much luck.
> What I want to end up with is a record like this:
> <DataTableRow>
>   <DataTableRowCell><strong>HOLIDAY - Labor
> Day</strong></DataTableRowCell>
> </DataTableRow>
> <DataTableRow>
>   <DataTableRowCell>September 06, 2004 08:00
> AM-September 06, 2004 05:00 PM (All
> Day)</DataTableRowCell>
> </DataTableRow>
> <DataTableRow>
>   <DataTableRowCell>Categories: Education Events,
> External Technical Meetings, General Interest, Public
> Outreach Events, Industry</DataTableRowCell>
> <DataTableRow>
>   <DataTableRowCell> </DataTableRowCell>
> </DataTableRow>
> Can someone lend a hand? The XML and XSLT files are
> too large to include, but can be downloaded here, in
> the XML-XSLT folder:
> Thanks a bunch in advance!
> --Nathan
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - 50x more storage than other providers!
> --+------------------------------------------------------------------
> XSL-List info and archive:
> To unsubscribe, go to:
> or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
> --+--

Current Thread