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

Re: Diagram of XPath axes

Subject: Re: Diagram of XPath axes
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 24 May 2012 18:06:47 -0400
Re:  Diagram of XPath axes
Hi Mike,

In teaching, I have used precisely the same approach as Ken, comprehensively dividing the document into the self, ancestor, descendant, following and preceding axes, all in relation to "me".

It is also worth pointing out, however, that there is some potential confusion, in that ancestors do appear "before me" in document order, while descendants appear "after me" in document order, even though (as Ken and others have noted), ancestors aren't yet done when I'm done, and descendants are all done before I'm done.

The human brain being what it is (rather messy), we then mix up the definition of document order with the specification of the different axes, and there we are. Yet the concepts are clean, if we allow them to be.

So yes, the preceding axis reaches nodes that occur *entirely* before me; and that necessarily excludes ancestors. By the same token, not all nodes before me in document order will precede me -- at least as long as I have an ancestor (which all nodes must, except document nodes).

Cheers,
Wendell

On 5/24/2012 8:58 AM, mlcook@xxxxxxxxxx wrote:
Ken Holman's diagram is the one I had seen before that summarized lots of info concisely. I'm sure I've seen it on xsl-list or somewhere else, but don't remember where.

Otherwise, Ihe Onwuka's suggestion does have tutorial information, but I didn't see an overall diagram.

Scott Trenda pointed to a site with diagrams for individual axis access which looks helpful.

Syd Bauman also points to tutorial diagrams for individual axes with examples, and one final summarizing diagram.


One additional question, please:


Preceding nodes do not include ancestors, which I've thought is odd. It includes siblings, but not parent or grand-parent, etc.

When looking at an XML file in an editor, ancestors surely seem to be preceding where I am in the document.

But perhaps "preceding" means nodes before "me" but not including anything that contains "me".

Is that a useful way to look at "preceding"?

Thanks again, Mike
--
======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================

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.