On 01/07/2024 15:04, ykhab...@bellsouth.net wrote:
Hello,

I am using the latest BaseX 11.0 final.

I am running an XSLT 3.0 transformation, by using SaxonHE12-4J, and hit a
snag with it.

The goal of the XSLT is to split large input XML file into few smaller XML
files.
The test case files: XML, XSLT, and xq, are below.

The XSLT transformation is working as expected, producing multiple output
files on the file system.
Alas, BaseX GUI emits the following error:
Error:
Stopped at C:/Program Files (x86)/basex/src/xslt_transform30.xq, 6/15:
[FODC0002] "" (Line -1): Premature end of file.

My XSLT is a little bit unusual.
It is leveraging powerful XSLT 3.0 functionality.
It doesn't have one single output, but many output files directly to the
file system,
IMHO, that's the reason for the BaseX error.
BaseX is expecting at least some output back from the XSLT transformation.

For comparison, the Oxygen XML IDE is working as expected with such XSLT.

What could be done to fix it?


I think your analysis is correct, it is not the use of XSLT 3 and
xsl:result-document that fails, but the lack of a primary result
document; as a workaround, it seems you can do e.g.

   <xsl:template match="/">
      <dummy/>
      <xsl:apply-templates select="doc/chapter/page"/>
   </xsl:template>

I am sure Christian will look into fixing it if JAXP allows it.


Reply via email to