Subject: Re: XPath2 preceding / following axis and attributes
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Tue, 10 Jan 2006 22:24:47 +1100
|
On 1/10/06, Michael Kay <mike@xxxxxxxxxxxx> wrote:
> I think the results here are correct. The text node "205" is a descendant
of
> the element containing the attribute, but it's not a descendant of the
> attribute, so it is included in the result.
>
> Or have I misunderstood?
You're right -- and this particular case is indeed quite tricky --
thanks to Soren Kuula for raising the question.
So, as a next attempt, are the following two XPath expressions equivalent:
someElement/@someAttribute/following::someNodeTest
and
someElement/@someAttribute/../following::someNodeTest
|
someElement/@someAttribute/../descendant::someNodeTest
--
Cheers,
Dimitre Novatchev
---------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all.
|