On Thu, Jun 02, 2022 at 02:56:30PM +0000, Zimmel, Daniel scripsit:
I see, thanks Gerrit and Christian for the insight. This *does* sound wickedly unfunny.
OK if I actually do not need to be able to parse the DTD wouldn't the simple workaround be:
fetch:xml('file:///C:/temp/catalog/dokument.xml') => xslt:transform('transform.xsl')
If you _do_ need to parse the catalog, the approach I've had success with is proc:execute().
In practice it turns into something like
let $fromXSLT as element(result) := proc:execute($settings:sysConf?javaCmd,$transform_args)
Where the transformation args are Saxon-from-the-command-line, catalog reference and all. (In production, there is plausibly a function assembling those. You sure don't want to type any of the component arguments more than once!)
It doesn't feel especially efficient, at least not with my biases, but it turns out that if the XSLT transform is doing its own transformation stages it performs well. BaseX is efficient at loading XML files so the separate step to slurp up the actual result document isn't a significant issue. (The result element is how proc:execute thinks things went, not what was produced when proc:execute ran whatever).