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

Tricky XPath Question

Subject: Tricky XPath Question
From: disco <disco@xxxxxxxxxxxxxxx>
Date: Tue, 30 Nov 1999 23:09:15 -0500 (EST)
xpath tricky question
Hi,
 
I'm trying to select all <term> elements in a document (multiple of which
may have the same content), for which the element is the first containing
its content.

I can do this in XSLT using:

  <xsl:for-each select="//term">
    <!-- first select all the terms in the document -->
    <xsl:for-each select="*[count(preceding::term[. = current()]) = 0]">
      <!-- then select all of those for which the number of preceding
           terms with the same content is zero -->
      ...
    </>
  </>

but I'd like to be able to do this more succinctly using one XPath
expression. I would be able to do this simply using

  //term[count(preceding::term[. = current()]) = 0]

except current() in this case refers to something else, and not the term
element in question.

How could I solve this?

Thanks,
Dan


 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.