|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








