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

Re: XPath expression to derive list of distinct elemen

Subject: Re: XPath expression to derive list of distinct element names
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 10 Jan 2002 11:28:07 GMT
xpath distinct
 
doesn't
  select="$x//*[not(following::*[name()=name(current())])]"
select all the element nodes in $x that are the last occurrence of an
  element of that name?

David



   I don't think it can be done in XPath 1.0. The "implicit existential equals" in XPath works only on node-sets, so it's only useful for eliminating nodes that have duplicate string-values, not duplicate values of some other function such as name().

   Mike Kay 

   > -----Original Message-----
   > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
   > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of 
   > Sean McMurray
   > Sent: 09 January 2002 19:48
   > To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
   > Subject:  XPath expression to derive list of distinct 
   > element names
   > 
   > 
   > I need an XPath expression that will return a list of node 
   > names it the 
   > tree frag.
   > I want the names to be distinct.
   > 
   > The best I can come up with is:
   >     "*[local-name() != local-name(preceding-sibling::*)]"
   > 
   > But the local-name function only gives the name of the first 
   > node in the 
   > nodeset.
   > 
   > This is really an XPath question. I'm not doing this in XSL, 
   > so I can't 
   > use templates or any other non-XPath construct.
   > It needs to be a single XPath expression.
   > 
   > Thanks for any help.
   > 
   > 
   >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
   > 
   > 


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



_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 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.