[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: Removing duplicates - grouping problem


Subject: RE: Removing duplicates - grouping problem
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Thu, 19 Oct 2000 11:21:36 +0100

>  I am new to XSLT.  I have looked for the answer but no luck
>  I am trying to group, sort and remove duplicates.
>  XML file
> ----- 
> <?xml version="1.0"?>
> 
> <UMLSCollection>
> <MetaGroup>
>    <concept>
>       <cn>Zygoma</cn>
>       <term>
>          <tn>Cheek Bone</tn>
>          <termVariant>
>             <str>Cheek Bone</str>
>             <strSource>
>                <sab>MSH2000</sab>
>             </strSource> 
>          </termVariant>
>          <termVariant>
>             <str>Cheek Bones</str>
>             <strSource>
>                <sab>MSH2000</sab>
>             </strSource> 
>          </termVariant>
> ----
> Stylesheet

> select="termVariant/strSource/sab[
not(.=preceding-sibling::termVariant/strSource/sab)]">
>
Your <sab> element will never have a preceding sibling that is a
<termVariant> element.

You want

select="termVariant[not(strSource/sab =
 preceding-sibling::termVariant/strSource/sab)]/strSource/sab

Mike Kay 


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



Current Thread
Keywords
xml