New axes?

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], rather than following-sibling::node()[1][self::*]. This is inconsistent with the parent axis, where parent::document-node() means ancestor::node()[1][self::document-node()]. But I doubt anyone would lose sleep over the inconsistency.

Another two candidates are following-sibling-or-self::* and preceding-sibling-or-self::*, with hopefully obvious semantics.

Michael Kay

Received on Wednesday, 2 December 2020 09:24:58 UTC