|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Tricky XPath 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






