p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

xslt thread: avoid dublicates...


Message #1 by "Stas" <stas@z...> on Fri, 20 Jul 2001 12:59:41 +0300
It's worth becoming familiar with the grouping techniques described at
http://www.jenitennison.com/xslt/grouping (or see Wrox XSLT Programmer's
Reference, 2nd edition).

As a starter, you can often get by with a construct such as
element[not(@name = preceding-sibling::element/@name)]

Mike Kay
Software AG

> -----Original Message-----
> From: Stas [mailto:stas@z...]
> Sent: 20 July 2001 11:00
> To: P2P_XSLT
> Subject: [xslt] avoid dublicates...
>
>
> hi all!!
>
> I have xml-document like:
>
> <root>
>    <element @name="first"></element>
>    <element @name="first"></element>
>    <element @name="first"></element>
>    <element @name="second"></element>
>    <element @name="second"></element>
>    <element @name="third"></element>
> </root>
>
>
> and my output should be (no dublicates of @name attribute are
> allowed):
>
> <root>
>    <element @name="first"></element>
>    <element @name="second"></element>
>     <element @name="third"></element>
> </root>
>
> Can you help me with template please???
>
> thx, Stas
>
>
> ---
> When you work at Microsoft, you don't have to wait for the
> latest technologies to be released. You'll create them ? with
> XML, SOAP, and C# -- and help decide what happens next.
> Find out where your career can take you: take a look at our
> software design engineer opportunities at
> http://www.microsoft.com/jobs.
>


  Return to Index