Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XSL Abbreviations

From: Matt Sergeant <matt@------------>
To:
Date: 7/3/2000 4:30:00 PM
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


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent