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

Ignoring sibling parents

Subject: Ignoring sibling parents
From: Kaine Varley <kaine.varley@xxxxxxxxxxxxxxxxxx>
Date: Tue, 6 May 2003 16:58:18 +0100
sibling parents
Hi all,

I find that I am unable to select the sibling information for siblings that
don't share the same parents. I use the following XPath statement, well
similar anyway, to return the sibling id, and it performed perfectly until I
encountered siblings with different parents:

	foobar/foo[@id=2]/following-sibling::foo[1]/@id
 	foobar/foo[@id=2]/preceding-sibling::foo[1]/@id


Original data:
<foobars>
	<foobar>
		<foo id="1" />
		<foo id="2" />
		<foo id="3" />
		<foo id="4" />
	</foobar>
</foobars>

But my problem occurred when I started receiving data like this, since I
still wanted to pick up <foo id="3"> id attribute:
<foobars>
	<foobar>
		<foo id="1" />
		<foo id="2" />
	</foobar>
	<foobar>
		<foo id="3" />
		<foo id="4" />
	</foobar>
</foobars>


I don't get anything even if I precede my XPath expressions above with
foobars/. Any suggestions?


Kaine


 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.