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

Re: 1st previous node()

Subject: Re: 1st previous node()
From: "Christopher R. Maden" <crism@xxxxxxxxx>
Date: Tue, 08 Feb 2011 09:24:47 -0500
Re:  1st previous node()
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/ >
bFor a successful technology, reality must take precedence over
 public relations, for Nature cannot be fooled.b b R.P. Feynman
GnuPG Fingerprint: C6E4 E2A9 C9F8 71AC 9724 CAA3 19F8 6677 0077 C319

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