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

Unexpected Context Node at Points in XPath Expression

Subject: Unexpected Context Node at Points in XPath Expression
From: "Michael Terry" <formido@xxxxxxxxx>
Date: Tue, 4 Sep 2007 15:03:03 -0700
 Unexpected Context Node at Points in XPath Expression
Unexpected to me, at least.

I've been familiarizing myself with XPath for a project by browsing
around the Internet with the Firefox extension XPath Checker.

On this page:

http://en.wikiquote.org/wiki/A.I.

... I tried the following:

id('bodyContent')/h2/following-sibling::*[position()<count(following-sibling::p[1]/preceding-sibling::*)
- count(preceding-sibling::*)]

... which I expected to select the 7 ul elements following the
specified h2. The next query DOES do that:

id('bodyContent')/h2[1]/following-sibling::*[position()<count(id('bodyContent')/h2[1]/following-sibling::p[1]/preceding-sibling::*)
- count(id('bodyContent')/h2[1]/preceding-sibling::*)]

The stuff I had to add in I had expected was already present as the
context node. Why was I wrong?

- mt

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-2007 All Rights Reserved.