[xsl] Unexpected Context Node at Points in XPath Expression

Subject: [xsl] Unexpected Context Node at Points in XPath Expression
From: "Michael Terry" <formido@xxxxxxxxx>
Date: Tue, 4 Sep 2007 15:03:03 -0700
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:


... I tried the following:

- count(preceding-sibling::*)]

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

- 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