[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Construct a list without duplicate element

Subject: Re: Construct a list without duplicate element
From: Éric Riblair <eriblair@xxxxxxxxxxxx>
Date: Wed, 30 Jun 1999 12:04:16 -0400
select without duplicates
Thanks for your answer,

I'd just try your code with no success ... in that way:

   <xsl:for-each select="SgPlantTypes/SgPlantType" order-by="@FCOLOR">
   <xsl:if test="@FCOLOR">
   <xsl:variable name="currentColor"><xsl:value-of
select="@FCOLOR"/></xsl:variable>
   <xsl:if
test="count(from-preceding-siblings(*[@FCOLOR=$currentColor]))=0">
       <DIV CLASS="listItem2">
           <A TARGET="weedsFCList">
           <xsl:attribute name="HREF">
              weedsFCList.asp?color=<xsl:value-of select="@FCOLOR"/>
           </xsl:attribute>
           <xsl:value-of select="@FCOLOR"/>
           </A>
        </DIV>
   </xsl:if>
   </xsl:if>
   </xsl:for-each>

Do you see in that code a problem ???
Does your code is compatible with the XSL processor of Microsoft (IE5)???

Éric Riblair,
Agronome
(eriblair@xxxxxxxxxxxx)
----- Original Message -----
From: Harbarth, Juliane <jhb@xxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxx>
Sent: Wednesday, June 30, 1999 9:45 AM
Subject: RE: Construct a list without duplicate element


>
> something like :
>
> <xsl:template match="plants">
>   <xsl:for-each select="plant" order-by="plant[@color]">
>    <xsl:variable name="currentColor"><xsl:value-of
> select="@color"/></xsl:variable>
>    <xsl:if
> test="count(from-preceding-siblings(plant[@color=$currentColor]))=0">
>     <plant>
>      <xsl:attribute name ="color">
>       <xsl:value-of select="@color"/>
>      </xsl:attribute>
>      <xsl:value-of select="."/>
>     </plant>
>    </xsl:if>
>   </xsl:for-each>
>   </xsl:template>
>
> is supposed to read in something that looks like :
>
> <plants>
>     <plant color="red">Rose1</plant>
>     <plant color="blue">Rose2</plant>
>     <plant color="red">Rose3</plant>
>     <plant color="green">Rose4</plant>
>     ...
>
> and output a list of plants omitting the ones of which the
> color occurred before.
>
> Juliane Harbarth
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.