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

Re: XSL Abbreviations

Subject: Re: XSL Abbreviations
From: Matt Sergeant <matt@xxxxxxxxxxxx>
Date: Mon, 3 Jul 2000 15:29:34 +0100 (BST)
abbreviations re
On Mon, 3 Jul 2000, Ben Pickering wrote:

> >Just reading the XPath docs wrong, that's all. // is equivalent to
> >/descendant-or-self::node()/ - note the leading and trailing slashes. You
> >could try ..//.[generate-id(.) = $node]
> 
> I tried you suggestion, but it doesn't seem to work, at least in XT.

Well it smells like a bug, but its hard to say without seeing your
code. The dot is simply equivalent to self::node() - i.e. no change
whatsoever in node position. It is specifically in the spec just for this
sort of hack. Of course you could try "..//self::node()[generate-id(.) =
$node]".

> Plus, can you explain the siginificance of the slashes, for curiosity's 
> sake:  I get that the leading '/' selects the document root (which is why 
> you need to say './/' rather than just '//' for the context node's parent; 
> the '//' includes a built-in '/' in front of descendant-or-self.)

You're trying to infer too much meaning, by the looks of things. Just
think of it as a kind-of macro expansion. The leading slash only selects
the root when its at the very beginning of a path (i.e. its an Absolute
Location Path). The slashes simply separate the Steps, like semi-colons in
a programming language separate lines of code. "//" is a full step, but it
also includes the slashes because otherwise you'd be writing "///" and
XPath would be even _more_ confusing :-)

-- 
<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 | AxKit: http://axkit.org


 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.