BaseX version

Tuesday, 3 November 2026 · 4 messages · last reply 4 Nov 2026
ML
Marco Lettere3 Nov 2026 16:49 #

Hello,

thanks a lot for the new version.

Is there a way to extract the version of BaseX from within xquery? It could be usable for alternating code paths without having to branch the code.

Regards,

Marco.

MH
Martin Honnen3 Nov 2026 16:58 #
Quoted text · Marco Lettere · 2 lines
On 03/11/2026 16:49, Marco Lettere via BaseX-Talk wrote: > Is there a way to extract the version of BaseX from within xquery?
db:system()/generalinformation/version
AB
Andy Buncein reply to Marco Lettere, 3 Nov 2026, 16:493 Nov 2026 18:20 #

Hi Marco,

Depending on your circumstances, an alternative to db:system()/generalinformation/version can be to test for the presence of the functions you want to use. See [1] for an example.

/Andy

[1] https://github.com/expkg-zone58/pdfbox/blob/3cafc6af046d2eac153b2bdf117fdcea84ff68ea/src/Pdfbox3.xqm#L522

Quoted text · Marco Lettere · 14 lines
On Tue, 3 Nov 2026 at 15:49, Marco Lettere via BaseX-Talk < basex-talk at mailman.uni-konstanz.de> wrote: > Hello, > > thanks a lot for the new version. > > Is there a way to extract the version of BaseX from within xquery? It > could be usable for alternating code paths without having to branch the > code. > > Regards, > > Marco. >
ML
Marco Lettere4 Nov 2026 09:13 #

In this case I need to know whether an option (trusted) is supported or not in xquery-load-module.

So, even if your solution is comfortable Andy, I think it will not apply for this scenario.

I'll use try{}catch{} because I'm too lazy to implement a complete, general-purpose version matching routine.

Thanks to both of you,

Marco.

Quoted text · Andy Bunce · 29 lines
On 11/3/26 18:20, Andy Bunce wrote: > > Hi Marco, > > Depending on your circumstances, an alternative to > `db:system()/generalinformation/version` can be to test for the > presence of the > functions you want to use. See [1] for an example. > > /Andy > > [1] > https://github.com/expkg-zone58/pdfbox/blob/3cafc6af046d2eac153b2bdf117fdcea84ff68ea/src/Pdfbox3.xqm#L522 > > On Tue, 3 Nov 2026 at 15:49, Marco Lettere via BaseX-Talk > <basex-talk at mailman.uni-konstanz.de> wrote: > > Hello, > > thanks a lot for the new version. > > Is there a way to extract the version of BaseX from within xquery? > It could be usable for alternating code paths without having to > branch the code. > > Regards, > > Marco. >

⚡Generated with XQuery