This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Removing duplicates - grouping problem


>  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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]