[Home] [By Thread] [By Date] [Recent Entries]


>
> 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


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member