This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Removing duplicates - grouping problem
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: Removing duplicates - grouping problem
- From: Kay Michael <Michael dot Kay at icl dot com>
- Date: Thu, 19 Oct 2000 11:21:36 +0100
- Reply-To: xsl-list at mulberrytech dot com
> 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