OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] XLST 'DISTINCT' Equivalent

[ Lists Home | Date Index | Thread Index ]

>
> I was wondering if there was a way of using XSLT to return a
> distinct set of
> values from an XML document?
>
> e.g.
>
> <TAG1>
>   <TAG2>John</TAG2>
>   <TAG2>Fred</TAG2>
>   <TAG2>John</TAG2>
> </TAG>
>
>
The simple way is //TAG2[not(.=preceding-sibling::TAG2)]

The more powerful, efficient, and complicated approach is Muenchian
grouping, described in all good XSLT textbooks and at
http://www.jenitennison.com/xslt/grouping

Mike Kay





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS