XML serialization issue with BaseX 13.0 snapshot and XML Calabash 3

Saturday, 24 October 2026 · 4 messages · last reply 26 Oct 2026
AG
Amanda Galtman24 Oct 2026 15:05 #

Hi, BaseX team.

The XSpec issue https://github.com/xspec/xspec/issues/2493 describes a problem with the latest BaseX 13.0 preview snapshot in which output is serialized as text instead of XML, when the query is being run through the XML Calabash extension for BaseX. The problem doesn't occur when the same query is run directly with BaseX (i.e., not through XML Calabash).

Is this a BaseX 13.0 bug or perhaps something that XML Calabash will need to adapt to, for compatibility with BaseX 13.0?

Below are steps that reproduce the problem outside of XSpec. (I'm attempting to attach a ZIP-file with the three files that steps 5-7 say to create, but if this mailing list doesn't accept attachments, I'll attach the ZIP-file to the GitHub issue mentioned above.)

1. From https://codeberg.org/xmlcalabash/xmlcalabash3/releases download and unzip xml-calabash-3.0.54.zip and basex-3.0.54.zip

2. Copy the jar files from basex-3.0.54.zip into the extra subdirectory within the location where you unzipped xml-calabash-3.0.54.zip

3. Set BASEX_JAR to the location of BaseX.jar. For this issue, use the 13.0 preview BaseX130-20261023.222738.zip

4. Set XMLCALABASH3_DIR to the directory where you unzipped xml-calabash-3.0.54.zip

5. All remaining steps are done in some current directory. Create a file named xmlcalabash-config.xml with this content:

declare namespace output = 'http://www.w3.org/2010/xslt-xquery-serialization';
declare option output:method 'xml';
<xml>Hi there</xml>

6. Create a file named query.xq with this content:

<?xml version="1.0" encoding="UTF-8"?>
<!-- https://docs.xmlcalabash.com/userguide/current/configuration.html -->
<cc:xml-calabash xmlns:cc="https://xmlcalabash.com/ns/configuration" version="1.0"
    default-xquery-processor="https://basex.org/"/>

7. Create a file named run-query.xpl with this content:

<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="3.1">
   <p:output port="result"/>
   <p:xquery>
      <p:with-input port="source"><p:empty/></p:with-input>
      <p:with-input port="query" href="query.xq"/>
   </p:xquery>
</p:declare-step>

8. From a shell window, enter this command:

java -cp "%XMLCALABASH3_JAR%;%XMLCALABASH3_DIR%\extra\*;%BASEX_JAR%" com.xmlcalabash.app.Main run-query.xpl --config:xmlcalabash3-config.xml

The output should be <xml>Hi there</xml>, but it is only the text Hi there.

9. Redefine BASEX_JAR to point to BaseX 12.4, and redo step 8. Now the output is <xml>Hi there</xml> as expected.

Thanks, Amanda

AG
Amanda Galtman24 Oct 2026 15:23 #

Oops, my reproduction steps mismatched the code blocks in steps 5 and 6. Here's the correction:

5. All remaining steps are done in some current directory. Create a file named xmlcalabash-config.xml with this content:

<?xml version="1.0" encoding="UTF-8"?>
<!-- https://docs.xmlcalabash.com/userguide/current/configuration.html -->
<cc:xml-calabash xmlns:cc="https://xmlcalabash.com/ns/configuration" version="1.0"
    default-xquery-processor="https://basex.org/"/>

6. Create a file named query.xq with this content:

declare namespace output = 'http://www.w3.org/2010/xslt-xquery-serialization';
declare option output:method 'xml';
<xml>Hi there</xml>
Quoted text · Amanda Galtman · 62 lines
On Saturday, October 24th, 2026 at 9:06 AM, Amanda Galtman via BaseX-Talk <basex-talk at mailman.uni-konstanz.de> wrote: > Hi, BaseX team. > > The XSpec issue https://github.com/xspec/xspec/issues/2493 describes a problem with the latest BaseX 13.0 preview snapshot in which output is serialized as text instead of XML, when the query is being run through the XML Calabash extension for BaseX. The problem doesn't occur when the same query is run directly with BaseX (i.e., not through XML Calabash). > > Is this a BaseX 13.0 bug or perhaps something that XML Calabash will need to adapt to, for compatibility with BaseX 13.0? > > Below are steps that reproduce the problem outside of XSpec. (I'm attempting to attach a ZIP-file with the three files that steps 5-7 say to create, but if this mailing list doesn't accept attachments, I'll attach the ZIP-file to the GitHub issue mentioned above.) > > 1. From https://codeberg.org/xmlcalabash/xmlcalabash3/releases download and unzip `xml-calabash-3.0.54.zip` and `basex-3.0.54.zip` > > 2. Copy the jar files from `basex-3.0.54.zip` into the `extra` subdirectory within the location where you unzipped `xml-calabash-3.0.54.zip` > > 3. Set `BASEX_JAR` to the location of `BaseX.jar`. For this issue, use the 13.0 preview `BaseX130-20261023.222738.zip` > > 4. Set `XMLCALABASH3_DIR` to the directory where you unzipped `xml-calabash-3.0.54.zip` > > 5. All remaining steps are done in some current directory. Create a file named `xmlcalabash-config.xml` with this content: > > ``` > declare namespace output = 'http://www.w3.org/2010/xslt-xquery-serialization'; > declare option output:method 'xml'; > <xml>Hi there</xml> > ``` > > 6. Create a file named `query.xq` with this content: > > ``` > <?xml version="1.0" encoding="UTF-8"?> > <!-- https://docs.xmlcalabash.com/userguide/current/configuration.html --> > <cc:xml-calabash xmlns:cc="https://xmlcalabash.com/ns/configuration" version="1.0" > default-xquery-processor="https://basex.org/"/> > ``` > > 7. Create a file named `run-query.xpl` with this content: > > ``` > <?xml version="1.0" encoding="UTF-8"?> > <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="3.1"> > <p:output port="result"/> > <p:xquery> > <p:with-input port="source"><p:empty/></p:with-input> > <p:with-input port="query" href="query.xq"/> > </p:xquery> > </p:declare-step> > ``` > > 8. From a shell window, enter this command: > > ``` > java -cp "%XMLCALABASH3_JAR%;%XMLCALABASH3_DIR%\extra\*;%BASEX_JAR%" com.xmlcalabash.app.Main run-query.xpl --config:xmlcalabash3-config.xml > ``` > > The output should be `<xml>Hi there</xml>`, but it is only the text `Hi there`. > > 9. Redefine `BASEX_JAR` to point to BaseX 12.4, and redo step 8. Now the output is `<xml>Hi there</xml>` as expected. > > > > Thanks, > Amanda >
CG
Christian Grünin reply to Amanda Galtman, 24 Oct 2026, 15:0526 Oct 2026 12:33 #

Hi Amanda,

I have written Norm to suggest a little bug fix in XML Calabash; I assume it will be best to fix it there.

However, I have also found a solution to provide an immediate fix in BaseX. Feel free to check out the latest snapshot.

Hope this helps, Christian

Quoted text · Amanda Galtman · 61 lines
> Hi, BaseX team. > > The XSpec issue https://github.com/xspec/xspec/issues/2493 describes a problem with the latest BaseX 13.0 preview snapshot in which output is serialized as text instead of XML, when the query is being run through the XML Calabash extension for BaseX. The problem doesn't occur when the same query is run directly with BaseX (i.e., not through XML Calabash). > > Is this a BaseX 13.0 bug or perhaps something that XML Calabash will need to adapt to, for compatibility with BaseX 13.0? > > Below are steps that reproduce the problem outside of XSpec. (I'm attempting to attach a ZIP-file with the three files that steps 5-7 say to create, but if this mailing list doesn't accept attachments, I'll attach the ZIP-file to the GitHub issue mentioned above.) > > 1. From https://codeberg.org/xmlcalabash/xmlcalabash3/releases download and unzip `xml-calabash-3.0.54.zip` and `basex-3.0.54.zip` > > 2. Copy the jar files from `basex-3.0.54.zip` into the `extra` subdirectory within the location where you unzipped `xml-calabash-3.0.54.zip` > > 3. Set `BASEX_JAR` to the location of `BaseX.jar`. For this issue, use the 13.0 preview `BaseX130-20261023.222738.zip` > > 4. Set `XMLCALABASH3_DIR` to the directory where you unzipped `xml-calabash-3.0.54.zip` > > 5. All remaining steps are done in some current directory. Create a file named `xmlcalabash-config.xml` with this content: > > ``` > declare namespace output = 'http://www.w3.org/2010/xslt-xquery-serialization'; > declare option output:method 'xml'; > <xml>Hi there</xml> > ``` > > 6. Create a file named `query.xq` with this content: > > ``` > <?xml version="1.0" encoding="UTF-8"?> > <!-- https://docs.xmlcalabash.com/userguide/current/configuration.html --> > <cc:xml-calabash xmlns:cc="https://xmlcalabash.com/ns/configuration" version="1.0" > default-xquery-processor="https://basex.org/"/> > ``` > > 7. Create a file named `run-query.xpl` with this content: > > ``` > <?xml version="1.0" encoding="UTF-8"?> > <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="3.1"> > <p:output port="result"/> > <p:xquery> > <p:with-input port="source"><p:empty/></p:with-input> > <p:with-input port="query" href="query.xq"/> > </p:xquery> > </p:declare-step> > ``` > > 8. From a shell window, enter this command: > > ``` > java -cp "%XMLCALABASH3_JAR%;%XMLCALABASH3_DIR%\extra\*;%BASEX_JAR%" com.xmlcalabash.app.Main run-query.xpl --config:xmlcalabash3-config.xml > ``` > > The output should be `<xml>Hi there</xml>`, but it is only the text `Hi there`. > > 9. Redefine `BASEX_JAR` to point to BaseX 12.4, and redo step 8. Now the output is `<xml>Hi there</xml>` as expected. > > > > Thanks, > Amanda >
AG
Amanda Galtman26 Oct 2026 15:02 #

Wonderful. Yes, that helps in both the small reproduction steps and the original task. Thanks a lot, Christian!

Best regards, Amanda

Sent with Proton Mail secure email.

Quoted text · Christian Grün · 73 lines
On Monday, October 26th, 2026 at 7:33 AM, Christian Grün <cg at basex.org> wrote: > Hi Amanda, > > I have written Norm to suggest a little bug fix in XML Calabash; I assume it will be best to fix it there. > > However, I have also found a solution to provide an immediate fix in BaseX. Feel free to check out the latest snapshot. > > Hope this helps, > Christian > > > > > Hi, BaseX team. > > > > The XSpec issue https://github.com/xspec/xspec/issues/2493 describes a problem with the latest BaseX 13.0 preview snapshot in which output is serialized as text instead of XML, when the query is being run through the XML Calabash extension for BaseX. The problem doesn't occur when the same query is run directly with BaseX (i.e., not through XML Calabash). > > > > Is this a BaseX 13.0 bug or perhaps something that XML Calabash will need to adapt to, for compatibility with BaseX 13.0? > > > > Below are steps that reproduce the problem outside of XSpec. (I'm attempting to attach a ZIP-file with the three files that steps 5-7 say to create, but if this mailing list doesn't accept attachments, I'll attach the ZIP-file to the GitHub issue mentioned above.) > > > > 1. From https://codeberg.org/xmlcalabash/xmlcalabash3/releases download and unzip `xml-calabash-3.0.54.zip` and `basex-3.0.54.zip` > > > > 2. Copy the jar files from `basex-3.0.54.zip` into the `extra` subdirectory within the location where you unzipped `xml-calabash-3.0.54.zip` > > > > 3. Set `BASEX_JAR` to the location of `BaseX.jar`. For this issue, use the 13.0 preview `BaseX130-20261023.222738.zip` > > > > 4. Set `XMLCALABASH3_DIR` to the directory where you unzipped `xml-calabash-3.0.54.zip` > > > > 5. All remaining steps are done in some current directory. Create a file named `xmlcalabash-config.xml` with this content: > > > > ``` > > declare namespace output = 'http://www.w3.org/2010/xslt-xquery-serialization'; > > declare option output:method 'xml'; > > <xml>Hi there</xml> > > ``` > > > > 6. Create a file named `query.xq` with this content: > > > > ``` > > <?xml version="1.0" encoding="UTF-8"?> > > <!-- https://docs.xmlcalabash.com/userguide/current/configuration.html --> > > <cc:xml-calabash xmlns:cc="https://xmlcalabash.com/ns/configuration" version="1.0" > > default-xquery-processor="https://basex.org/"/> > > ``` > > > > 7. Create a file named `run-query.xpl` with this content: > > > > ``` > > <?xml version="1.0" encoding="UTF-8"?> > > <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="3.1"> > > <p:output port="result"/> > > <p:xquery> > > <p:with-input port="source"><p:empty/></p:with-input> > > <p:with-input port="query" href="query.xq"/> > > </p:xquery> > > </p:declare-step> > > ``` > > > > 8. From a shell window, enter this command: > > > > ``` > > java -cp "%XMLCALABASH3_JAR%;%XMLCALABASH3_DIR%\extra\*;%BASEX_JAR%" com.xmlcalabash.app.Main run-query.xpl --config:xmlcalabash3-config.xml > > ``` > > > > The output should be `<xml>Hi there</xml>`, but it is only the text `Hi there`. > > > > 9. Redefine `BASEX_JAR` to point to BaseX 12.4, and redo step 8. Now the output is `<xml>Hi there</xml>` as expected. > > > > > > > > Thanks, > > Amanda > >

⚡Generated with XQuery