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

XSL returning only unique (non-duplicate) nodes

Subject: XSL returning only unique (non-duplicate) nodes
From: "Todd Binder" <todd_binder@xxxxxxxxxxx>
Date: Mon, 29 Oct 2001 22:19:35 -0500
xsl unique duplicate
I am trying to use XSL to filter out all repeated records from a source XML
file below, so that I will only be working with a single instance of a given
show @id

when i use the following

 <xsl:variable name="unique-list"
select="//seminars/seminar[@nodeid=$nodeid]/schedule/show/@id[not(.=precedin
g::schedule/show/@id)]" />

I am able to get the correct 3 elements for @nodeid="1", but if I set
@nodeid="2", I get 0 elements

and when i reverse it (change preceding:: to following::)
 <xsl:variable name="unique-list"
select="//seminars/seminar[@nodeid=$nodeid]/schedule/show/@id[not(.=followin
g::schedule/show/@id)]" />

I get the opposite, 3 elements for @nodeid="2", but if I set @nodeid="1", I
get 0 elements

note: $nodeid is a <xsl:parameter> set to either 1 or 2

how do I limit the following:: and preceding:: to only look in the path that
I am specifying --> //seminars/seminar[@nodeid=$nodeid]/schedule/show <--
and not any other part of hte XML document?

source XML file
<seminars>
  <seminar nodeid="1">
     <schedule><show id="intro"/></schedule>
     <schedule><show id="pmw"/></schedule>
     <schedule><show id="ib"/></schedule>
     <schedule><show id="pmw"/></schedule>
   </seminar>
   <seminar nodeid="2">
     <schedule><show id="intro"/></schedule>
     <schedule><show id="ccr"/></schedule>
     <schedule><show id="ib"/></schedule>
     <schedule><show id="ccr"/></schedule>
   </seminar>
</seminars>



 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.