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

Re: avoiding repeated items

Subject: Re: avoiding repeated items
From: cutlass <cutlass@xxxxxxxxxxx>
Date: Thu, 01 Mar 2001 18:42:15 +0000
xsl filter repeated items
not to be a url pusher .....

http://www.dpawson.co.uk/xsl/N2696.html

in general this will say,

a) find all <autor> elements and put the resulant tree in a variable, with a filter getting rid of duplicates ( something like the following )

<xsl:variable name="uniquelist" select="//autor[not(.=following::autor)]"/>


you may have a problem with some parsers, most recent version of sablotron has a problem with these types of xpaths.


cheers, jim


Aniceto López wrote:


hi:
simple question: how to avoid repeated elements?
in a xml file like this
<poetas>
  <autor>anonimo</autor>
  <autor>arcipreste de hita</autor>
  <autor>becquer</autor>
  <autor>becquer</autor>
  <autor>becquer</autor>
  <autor>campoamor</autor>
  <autor>dario</autor>
  <autor>encina</autor>
  <autor>encina</autor>
  <autor>encina</autor>
  <autor>espronceda</autor>
  <autor>garcilaso</autor>
  <autor>gongora</autor>
  <autor>gongora</autor>
  <autor>gongora</autor>
  <autor>lope</autor>
</poetas>


<xsl:variable name="uniquelist" select="//autor[not(.=following.autor]"> <xsl:for-each select="$uniquelist"> <xsl:value-of select="."/> </xsl:for-each>


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.