Gunther, Thank you for explaining what is going on! As a bit of extra background on the original reproduction steps, in case it informs the clarification discussion: when XSpec compiles a test document (which is in XML format) into an XQuery query, XSpec produces a lot of URI-qualified names. They avoid collisions or incorrect names, if a test author used a prefix to mean different things in different parts of the XML tree of the test document. I am interested in finding out about the eventual resolution of this matter in the spec. Is there a GitHub issue number that I can keep an eye on? Best regards, Amanda On Tuesday, May 26th, 2026 at 4:03 PM, Gunther Rademacher <grd@gmx.net> wrote:
Hi Amanda, thank you for the concise reproduction.
This is triggered by BaseX's handling of the "reserved-function-names" grammar constraint. `namespace-node` is one of the reserved function names, and the spec [1] says that such names are not allowed as an "unprefixed function name".
The open question is whether an `EQName` written as a `URIQualifiedName`, such as `Q{some-uri}namespace-node`, should count as "unprefixed" for this constraint. It has no namespace prefix, but it is also not the ambiguous form `namespace-node()`, since the `Q{...}` syntax unambiguously identifies it as a function call, not a node kind test.
We are currently clarifying the intended interpretation of the spec and will decide how to proceed from there. For now, using a namespace prefix is the best workaround.
Best regards, Gunther
[1] https://qt4cg.org/specifications/xquery-40/xquery-40.html#parse-note-reserve...
Gesendet: Dienstag, 26. Mai 2026 um 15:26 Von: "Amanda Galtman via BaseX-Talk" <basex-talk@mailman.uni-konstanz.de> An: "basex-talk@mailman.uni-konstanz.de" <basex-talk@mailman.uni-konstanz.de> Betreff: [basex-talk] Error parsing query, related to qualified name of function Hi, BaseX team.
An XSpec user found an error when running a particular test with BaseX. I reproduced the error in its original form, and I also shrunk the reproduction steps to obtain a similar error.
The small, self-contained reproduction steps in BaseX 12.2, 12.3, or BaseX124-20260521.170507 are:
xquery version "3.1"; declare namespace pfx = "some-uri"; declare function pfx:namespace-node() { 'some result' }; declare function pfx:my-fcn() { Q{some-uri}namespace-node() }; pfx:my-fcn()
Error message: [XPST0003] Expecting '}', found '('. It points to the end of the qualified function name Q{some-uri}namespace-node.
The error does not occur if I call the function using a prefix pfx:namespace-node() or if I change the function's local name.
The original reproduction steps are in https://github.com/xspec/xspec/issues/2354 . In that context, the error does not occur if I change the function's local name in both the XQuery module being tested and the XSpec test file.
Thanks, Amanda