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

RE: Xpath and copy-of

Subject: RE: Xpath and copy-of
From: John Robert Gardner <jrgardn@xxxxxxxxx>
Date: Fri, 9 Jun 2000 15:04:05 -0400 (EDT)
xpath copy of
On Fri, 9 Jun 2000, Matt Sergeant wrote:

> On Fri, 9 Jun 2000, Liu, Ying wrote:
> 
> > But as I read the XPath recommendation, child is an expression and so is
> > parent.
> > Did I have some misunderstanding?
> 
> Yes, child and parent are axes.

It's possible that too many cooks answering this can spoil the respective
vichy soisse, but I'm going to hazard a reply along the lines that made
sense to me.  child:: is the default axis . . . for that reason it does
not have to be explicitly declared.  Every node of your instance is a
child node except the root ( "/" ), which has no parent.  PI's, document
type declarations and namespace declarations, as well as the root element,
are all children of the root.  Any other node is a descendant of the root
and a child of the context node in which it is found-- the context node
for an attribute is the element in which it is found, the context node for
an element is the element which is its ".." or parent.

Quoting the spec, 2.5, that finally sorted out this ubiquitous yet
esoteric child:: for me, is the following:

<snip>
The most important abbreviation is that child:: can be omitted from a
location step. In effect, child is the default axis. For example, a
location path div/para is short for child::div/child::para.
</snip>

Declaring child:: gets you into trouble, so to speak, because it is always
already implicitly declared.

jr

=-=-=-=-=-=-=-=-=-==-=-=-=
John Robert Gardner, Ph.D.
XML Engineer
Emory University
------------------------------------------------------------
http://vedavid.org/diss/
"There is a difference between knowing The Path, and walking the Path."
					-Lawrence Fishburn/Morpheus

> 
> -- 
> <Matt/>
> 
> Fastnet Software Ltd. High Performance Web Specialists
> Providing mod_perl, XML, Sybase and Oracle solutions
> Email for training and consultancy availability.
> http://sergeant.org http://xml.sergeant.org
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.