Re: [xsl] // expanding to descendant-or-self::node()

Subject: Re: [xsl] // expanding to descendant-or-self::node()
From: Evan Lenz <evan@xxxxxxxxxxxx>
Date: Wed, 17 Sep 2008 09:02:28 -0700
Wendell Piez wrote:
At 07:44 PM 9/16/2008, Evan wrote:
So, instead, you'd have to write (@* | ./descendant::*/@*). In that case, the actual definition of // is handy.

Or, "descendant-or-self::*/@*", the long way, which works in any case (and is a good thing to know how to write even if you never write it).


The bottom line seems to be that like many features of many technologies, "//" works best for those who can also do without it. And this would probably be true no matter how it was defined.

Good point. And I'm really not trying to defend the final design as the best one. If "//" was short for "/descendant::" as so many people seem to intuit (rather logically for 90%+ of cases), then that would have eliminated the biggest related gotcha: the distinction between //foo[1] and (//foo)[1]. That has got to be the biggest downside of the way "//" is defined.


On the other hand, if we took out all the quirks and gotchas, we'd have fewer excuses to enjoy each other's company on XSL-List. :-)

Evan

Current Thread