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

Re: limiting preceding axis by ancestor

Subject: Re: limiting preceding axis by ancestor
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Tue, 07 May 2002 22:28:07 +0200
words preceding bar
Fox, Michael wrote:
I have a document where there are many instances of <foo>. Each <foo> may
have many <bar> children. <bar> is itself recursive to several levels.


<foo>
	<bar>
	<bar>
<foo>
	<bar>
		<bar>
			<bar>

I want to test to see if any preceding <bar> has the same value as the
current <bar> but limit the test to those <bar> elements are children of the
immediate <foo> ancestor.   In other words, I want to exclude any <bar>
children of the ancestor::foo's preceding-sibling:foo

Try preceding::bar[generate-id()=generate-id(current()/ancestor::foo)] or ancestor::foo//bar[following::bar[count(.|current())=1]] Either can be inefficient, depending on the actual XML.

J.Pietschmann



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.