Skip to content

Skip reserved-function-name check for URIQualifiedLiteral#2681

Merged
ChristianGruen merged 2 commits into
BaseXdb:mainfrom
GuntherRademacher:reserved-function-names
May 27, 2026
Merged

Skip reserved-function-name check for URIQualifiedLiteral#2681
ChristianGruen merged 2 commits into
BaseXdb:mainfrom
GuntherRademacher:reserved-function-names

Conversation

@GuntherRademacher
Copy link
Copy Markdown
Member

The XQuery spec, since 1.0, contains a constraint named reserved-function-names with a formulation like this or similar:

Unprefixed function names spelled the same way as language keywords could make the language impossible to parse. For instance, element(foo) could be taken either as a FunctionCall or as an ElementTest. Therefore, an unprefixed function name must not be any of the names in A.4 Reserved Function Names.

The current implementation in BaseX focuses on "unprefixed" and thus tests the absence of a prefix. This may result in a URIQualifiedName being rejected, if its local name is in the list of reserved names.

I do not consider this as correct. The motivation behind the constraint is the ambiguity that arises when a plain name is used. For a URIQualifiedName, this ambiguity does not exist - the Q{uri}local-name form unambiguously stands for a QName.

I thus propose to make the implementation focus on the spec's wording "function names spelled the same way as language keywords", and treating URIQualifiedNames as outside the constraint's scope.

This is implemented in this PR.

@ChristianGruen ChristianGruen merged commit 2c7c65e into BaseXdb:main May 27, 2026
1 check passed
@ChristianGruen ChristianGruen deleted the reserved-function-names branch May 27, 2026 15:50
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