Issue when XML catalog prefix has a number
Hi, BaseX team.
When an XML catalog has an entry <rewriteURI rewritePrefix="./" uriStartString="cat:/" /> I can use it with a declaration like this:
import module "x-urn:test:helper" at "cat:/helper.xqm";
However, a colleague noticed that if we change uriStartString to include a number and change the import declaration accordingly, then the result is an error like these:
[XQST0046] Invalid URI: cat1:/helper.xqm. [XQST0046] Invalid URI: c0at:/helper.xqm.
I'm seeing this behavior in BaseX 12.0, 12.4, and the 13.0 preview "BaseX 13.0 beta 39ebac5".
I'm attaching a ZIP-file with relevant files to reproduce the issue. The BaseX command is:
%BASEX_DIR%\bin\basex.bat -OCATALOG="catalog-rewriteURI.xml" -Qtest.xq
Thanks, Amanda
Hi Amanda,
URIs tend to cause trouble. Please look at the latest snapshot, it should provide a fix [1].
Best, Christian
Quoted text · Amanda Galtman · 21 lines
Amanda Galtman via BaseX-Talk <basex-talk at mailman.uni-konstanz.de> schrieb am Donnerstag, 29. Oktober 2026 um 13:41: > Hi, BaseX team. > > When an XML catalog has an entry <rewriteURI rewritePrefix="./" uriStartString="cat:/" /> I can use it with a declaration like this: > > import module "x-urn:test:helper" at "cat:/helper.xqm"; > > However, a colleague noticed that if we change uriStartString to include a number and change the import declaration accordingly, then the result is an error like these: > > [XQST0046] Invalid URI: cat1:/helper.xqm. > [XQST0046] Invalid URI: c0at:/helper.xqm. > > I'm seeing this behavior in BaseX 12.0, 12.4, and the 13.0 preview "BaseX 13.0 beta 39ebac5". > > I'm attaching a ZIP-file with relevant files to reproduce the issue. The BaseX command is: > > %BASEX_DIR%\bin\basex.bat -OCATALOG="catalog-rewriteURI.xml" -Qtest.xq > > Thanks, > Amanda >
Hi, Christian.
Yes, they do, and not only in BaseX! Thanks for the latest snapshot. The URI is now resolved as expected, in the reproduction steps I described in the email and in my original test case.
Best regards, Amanda
Quoted text · Christian Grün · 33 lines
On Thursday, October 29th, 2026 at 3:06 PM, Christian Grün <cg at basex.org> wrote: > Hi Amanda, > > URIs tend to cause trouble. Please look at the latest snapshot, it should provide a fix [1]. > > Best, > Christian > > [1] https://files.basex.org/releases/latest/ > ____________________________________ > > Amanda Galtman via BaseX-Talk <basex-talk at mailman.uni-konstanz.de> schrieb am Donnerstag, 29. Oktober 2026 um 13:41: > > > Hi, BaseX team. > > > > When an XML catalog has an entry <rewriteURI rewritePrefix="./" uriStartString="cat:/" /> I can use it with a declaration like this: > > > > import module "x-urn:test:helper" at "cat:/helper.xqm"; > > > > However, a colleague noticed that if we change uriStartString to include a number and change the import declaration accordingly, then the result is an error like these: > > > > [XQST0046] Invalid URI: cat1:/helper.xqm. > > [XQST0046] Invalid URI: c0at:/helper.xqm. > > > > I'm seeing this behavior in BaseX 12.0, 12.4, and the 13.0 preview "BaseX 13.0 beta 39ebac5". > > > > I'm attaching a ZIP-file with relevant files to reproduce the issue. The BaseX command is: > > > > %BASEX_DIR%\bin\basex.bat -OCATALOG="catalog-rewriteURI.xml" -Qtest.xq > > > > Thanks, > > Amanda > >
Written for BaseX 12.4. BaseX may have changed since: please check the current documentation.