[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSL Abbreviations
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
|
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
|