Re: [xsl] Unexpected Context Node at Points in XPath Expression

Subject: Re: [xsl] Unexpected Context Node at Points in XPath Expression
From: "Michael Terry" <formido@xxxxxxxxx>
Date: Tue, 4 Sep 2007 16:31:27 -0700
> I should look more carefully: the link that my mailprog (thunderbird)
> makes of it does not include the trailing dot (as normally a link
> wouldn't end on any and the dot it part of the sentence). Anyway, I see
> now that the other page *is* different and does contain <h2> tags. And
> now both queries select something (and different things). Sorry for my
> first mistaken interpretation of your queries...
>
> -- Abel Braaksma
>
>

I think I misunderstood what becomes the context node. Take the first
one I mentioned:

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

I thought that while the position() filter was running, 'h2[1]' would
be the context node. Instead, it seems the result of
'following-sibling::*' is the context node? What, does it change the
context node to each item in that set as it applies the filter? I
don't suppose there's a way to refer to the previous context node in a
relative way, is there?

Regardless, I'm interested to know of any alternate ways to express
the the second query, which gathers the desired results.

- mt

Current Thread