Skip to content

Disallow processing instructions in name tests - #2764

Merged
ChristianGruen merged 1 commit into
BaseXdb:mainfrom
GuntherRademacher:#2764
Sep 22, 2026
Merged

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

Conversation

@GuntherRademacher

Copy link
Copy Markdown
Member

A name test has been observed to return processing instructions in its result. This is reproducible by

declare function local:f($done, $todo) {
  if(empty($todo)) then $done else local:f(($done, head($todo)), tail($todo))
};
local:f((), (<e/>, <?pi?>))/self::*

It is caused by NameTest proceding to name matching as soon as kind == Kind.NODE, which also lets processing instructions slip through.

Fixed here by adding checks for Kind.ELEMENT and Kind.JNODE.

@ChristianGruen
ChristianGruen merged commit 166ea9b into BaseXdb:main Sep 22, 2026
1 check passed
@ChristianGruen
ChristianGruen deleted the #2764 branch September 22, 2026 06:47
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