- From: Christian Grün <cg@basex.org>
- Date: Wed, 2 Dec 2020 14:17:06 +0100
- To: Edward Porter <Edward.Porter@sas.com>
- Cc: Christian Grün <cg@basex.org>, Michael Kay <mike@saxonica.com>, Norm Tovey-Walsh <norm@saxonica.com>, "public-xslt-40@w3.org" <public-xslt-40@w3.org>
I agree with Michael Kay that it would probably be better to define this as a function. Otherwise, it might not be very obvious what sibling::*[1] is supposed to return. Next, people might expect an equivalent vertical axis that combines descendants and ancestors. ____________________________________ On Wed, Dec 2, 2020 at 2:05 PM Edward Porter <Edward.Porter@sas.com> wrote: > > If adding syntactic sugar next:: and previous::, could we also consider adding sibling:: to look in both directions? All three would make for more readable xpath, in my opinion. > > -----Original Message----- > From: Christian Grün <cg@basex.org> > Sent: Wednesday, December 2, 2020 5:08 AM > To: Michael Kay <mike@saxonica.com> > Cc: Norm Tovey-Walsh <norm@saxonica.com>; public-xslt-40@w3.org > Subject: Re: New axes? > > EXTERNAL > > An alternative would be to introduce new functions: > > fn:next-sibling($node as node()?) as node()? > fn:previous-sibling($node as node()?) as node()? > > Similar to fn:has-children, we cannot perform straightforward node tests. The requirement for such tests may depend on the use cases we are trying to solve. > ____________________________________ > > On Wed, Dec 2, 2020 at 10:51 AM Michael Kay <mike@saxonica.com> wrote: > > > > It's a fairly cosmetic change to get rid of a minor ugliness. People often forget the [1] qualifier when they only want the immediately following sibling, and the difference between preceding-sibling::*[predicate][1] and preceding-sibling::*[1][predicate] isn't intuitive. > > > > The problem of course is that you can never get rid of a danger point on a well-trodden road by providing a new shiny road; the very people who fall into the trap will be unaware of the new features. > > > > Michael Kay > > Saxonica > > > > On 2 Dec 2020, at 09:38, Norm Tovey-Walsh <norm@saxonica.com> wrote: > > > > Michael Kay <mike@saxonica.com> writes: > > > > How would anyone feel about adding new axes next::* and previous::* to > > get the first following/preceding sibling? > > > > Or next-sibling / previous-sibling if people prefer long names. > > > > It would have to be that next::* means following-sibling::*[1] > > > > > > Can next::* ever be different from (following-sibling::*)[1]? > > > > Another two candidates are following-sibling-or-self::* and > > preceding-sibling-or-self::*, with hopefully obvious semantics. > > > > > > What are the use cases for these? > > > > To me, it feels like adding a new axis is a fairly heavyweight change. > > There are already quite a few axes and I think users sometimes > > struggle to understand them. I’m not saying we must not add new axes, > > but I’d like to be convinced that their utility justifies them. > > > > Be seeing you, > > norm > > > > -- > > Norm Tovey-Walsh > > Saxonica > > > > >
Received on Wednesday, 2 December 2020 13:17:32 UTC