Subject: Re: 1st previous node()
From: Karl Stubsjoen <kstubs@xxxxxxxxx>
Date: Wed, 9 Feb 2011 23:32:38 -0800
|
Yes, good reading. Thanks!
On Tue, Feb 8, 2011 at 6:24 AM, Christopher R. Maden <crism@xxxxxxxxx> wrote:
> On 02/08/2011 01:16 AM, Karl Stubsjoen wrote:
>> Given that <X> is the context node then I expect the previous node is
>> <B>.
>>
>> <A>
>> <B>
>> <X> this is context node </X>
>> </B>
>> </A>
>
> This suggests to me that you are thinking about *tags*, not *nodes*.
>
> B is the ancestor of X, not its predecessor.
>
> This paragraph from XPath 1.0 may help:
>
>> NOTE: The ancestor, descendant, following, preceding and self axes
>> partition a document (ignoring attribute and namespace nodes): they
>> do not overlap and together they contain all the nodes in the
>> document.
>
> Others have already pointed out the usefulness of * over node() in your
> examples, and the possible utility of the preceding-sibling axis. I
> recommend re-reading <URL: http://www.w3.org/TR/xpath/#axes >, or the
> more precise but harder to read <URL: http://www.w3.org/TR/xpath20/#axes >.
>
> ~Chris
> --
> Chris Maden, text nerd <URL: http://crism.maden.org/ >
> For a successful technology, reality must take precedence over
> public relations, for Nature cannot be fooled. R.P. Feynman
> GnuPG Fingerprint: C6E4 E2A9 C9F8 71AC 9724 CAA3 19F8 6677 0077 C319
>
>
--
Karl Stubsjoen
MeetScoresOnline.com
(602) 845-0006
|