xsl-list
[Top] [All Lists]

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

2008-09-16 19:52:32
Also, I've occasionally run into an unfortunate, seemingly arbitrary consequence of this design, due to the syntax-oriented restrictions of XSLT patterns: you can use "//" in patterns but not "descendant::" (except in predicates).

I know there have been situations where this annoyed me, but I'm having trouble thinking of an example at the moment.

Evan

Michael Kay wrote:
Why does // expand to descendant-or-self::node() rather than to descendant::x where x is the next item in the path?

I've always imagined it was primarily to make //@x work; though I'm not at
all convinced it was a smart decision. Certainly in practice it's very rare
to see any axis other than "child" after "//" (for example //.., or
//following-sibling::x is never seen in practice and never required; and
//@x is something one could live without).

I think making "//" expand to "/descendant::" might well have been a better
design.

Michael Kay
http://www.saxonica.com/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--