Just a short note from abroad:

BaseX 10 will be based on Java 11, which provides better and native support for XML catalogs. We're always interested in feedback on the latest 10.0 snapshot:

https://files.basex.org/maven/org/basex/basex/10.0-SNAPSHOT/

Some challenges with Saxon will remain with version 10; maybe they'll eventually need to be tackled by Saxonica.(see [1] for more details).

Most probably, we won't spend additional time in improving catalog support with BaseX 9.

[1] https://github.com/BaseXdb/basex/issues/1903





Imsieke, Gerrit, le-tex <gerrit.imsieke@le-tex.de> schrieb am Do., 2. Juni 2022, 16:24:
Hi Daniel,

I think the catalog in xslt:transform() is only used for XSLT
imports/includes and maybe for reading documents with doc(), and only
for Saxon. The catalog is probably *not* used for mapping system
identifiers in the documents accessed this way. We should document this
better once we find out what is/isn’t supported.

The background is that we desperately needed to use catalogs for mapping
import/include URIs, and we paid Liam to implement this. He succeeded
with a little help from Christian, but it was not an easy feat because
include/import URI resolution is different from doc() URI resolution in
Saxon which in turn is different from system identifier resolution (that
is probably done by the XML parser, not by Saxon).

So I think we need to pay Liam and Christian again so that they work out
how to pass the catalog to the XML parser that is invoked by Saxon. This
definitely isn’t a fun task.

Gerrit

On 02.06.2022 14:44, Zimmel, Daniel wrote:
> Hi,
>
> after reading https://docs.basex.org/wiki/Catalog_Resolver and digging in the list archives (https://mailman.uni-konstanz.de/pipermail/basex-talk/2019-March/014199.html ) I still have trouble understanding catalog files.
>
> Is this supposed to work with xslt:transform() and BaseX GUI 9.7.2?
> The default option (DTD = false) is ignored by xslt:transform() because the function is definitely requesting the external DTD.
> This prevents transforming XML with DTD declarations that are not available (if I understand correctly, a problem that the DTD option is trying to solve in general).
>
> When I try to solve this via catalog files (actually I do not need the DTD), I do not have success.
> Here are my mini examples:
>
> Saxon HE 10.3 resides in the lib folder
>
> .basex setting:
> # Local Options
> SERIALIZER = indent=no
> DTD = true
>
> XML in local folder "C:/temp/catalog":
> <!DOCTYPE dokument
>    SYSTEM "http://www.blahblahblah.info/dtd/dokument.dtd">
> <dokument>
>    <doknr>01</doknr>
> </dokument>
>
> catalog.xml in local folder "C:/temp/catalog":
> <catalog prefer="system" xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
>    <rewriteSystem systemIdStartString="http://www.blahblahblah.info/dtd/" rewritePrefix="file:///C:/temp/catalog/dtd/"/>
> </catalog>
>
> dokument.dtd in local folder "C:/temp/catalog/dtd":
> <!ELEMENT dokument (doknr)>
> <!ELEMENT  doknr (#PCDATA)>
>
> XQuery query.xq in local folder "C:/temp/catalog":
> (# db:catfile catalog.xml #) {
>    xslt:transform('dokument.xml', 'transform.xsl')
> }
>
>
> With or without pragma, this always results in a java.net.UnknownHostException (because the system ID is not available, that's true), but I would be expecting this would resolve to "file:///C:/temp/catalog/dtd/dokument.dtd"
>
> Not working in GUI nor via CCL.
>
> What am I getting wrong?
>
> Thanks, Daniel
>

--
Gerrit Imsieke
Geschäftsführer / Managing Director
le-tex publishing services GmbH
Weissenfelser Str. 84, 04229 Leipzig, Germany
Phone +49 341 355356 110, Fax +49 341 355356 510
gerrit.imsieke@le-tex.de, http://www.le-tex.de

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

Geschäftsführer / Managing Directors:
Gerrit Imsieke, Svea Jelonek, Thomas Schmidt