Skip to content

Fix node kind checks - #2768

Merged
ChristianGruen merged 1 commit into
BaseXdb:mainfrom
GuntherRademacher:#2768
Sep 23, 2026
Merged

ChristianGruen merged 1 commit into
BaseXdb:mainfrom
GuntherRademacher:#2768

Conversation

@GuntherRademacher

Copy link
Copy Markdown
Member

The changes in bbd7744 have caused these differences in the behaviour of location steps:

  • descendant-or-self steps can lose their name test, when merged with a subsequent step. This makes this query return an empty sequence:

    declare function local:f($html as node()) {
      $html//text() except $html/descendant-or-self::b//node()
    };
    let $html := <a>X</a>
    return local:f($html)
  • a narrower type of a name test in a self step may be overridden by the broader node(), e.g. in

    declare function local:f($html as node()) {
      $html/self::b
    };
    local:f#1

This is caused by checks in Path.mergeStep and Step.assignType that were changed in bbd7744. With the fix here, both checks now require the test to be one of the NodeTest wildcard singletons (NodeTest.NODE / JNODE / XNODE), rather than to just carry the same kind.

@ChristianGruen
ChristianGruen merged commit 9503a19 into BaseXdb:main Sep 23, 2026
1 check passed
@ChristianGruen
ChristianGruen deleted the #2768 branch September 23, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants