Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different treatment of empty primary p:xslt results in 1.1.25-99 #288

gimsieke opened this issue Mar 31, 2019 · 4 comments

Different treatment of empty primary p:xslt results in 1.1.25-99 #288

gimsieke opened this issue Mar 31, 2019 · 4 comments


Copy link

@gimsieke gimsieke commented Mar 31, 2019

Thank you for 1.1.25-99. Together with Saxon, it certainly solves issue #281. Apart from that, almost everything else seems to work as expected. I employed it in a configuration with complex and diverse pipelines and many test documents. There were differences in attribute order and in indentation (end tags no longer in a line of their own, which is a plus). This is certainly due to changes in Saxon 9.9, they are Ok.

I stumbled over one kind of new error in our pipelines, and I boiled it down to this example:


<p:declare-step xmlns:p="" 
  xmlns:c="" version="1.0" name="mystep">

  <p:input port="source" primary="true">

  <p:import href=""/>
  <p:xslt name="xslt">
    <p:input port="parameters">
    <p:input port="stylesheet">
      <p:document href="Untitled3.xsl"/>
      <p:pipe port="secondary" step="xslt"/>
      <p:pipe port="result" step="xslt"/>
      <p:with-option name="message" select="base-uri(), ' :: ', count(/), ' :: ', count(/node())"/>
      <p:with-option name="href" select="concat(base-uri(), '.new')"/>


<xsl:stylesheet xmlns:xsl=""
  <xsl:template match="/">
    <xsl:result-document href="f">
      <xsl:copy-of select="node()"/>

This stylesheet doesn’t produce a primary output.

With 1.1.21 and Saxon 9.8, I get the following message:

Message: file:/C:/cygwin/home/gerrit/Dev/Calabash/xmlcalabash-1.1.21-98/f :: 1 :: 1

With 1.1.25 and Saxon 9.9, I get this:

Message: file:/C:/cygwin/home/gerrit/Dev/Calabash/xmlcalabash-1.1.25-99/f :: 1 :: 1
Message: file:/C:/cygwin/home/gerrit/Dev/Calabash/Untitled4.xpl :: 1 :: 0
ERROR: Pipeline failed: null

The error happens when p:store tries to store the empty document node that 1.1.25-99 returned on the primary p:xslt port.

I think in XProc 1.0, p:xslt needs to produce exactly one well-formed XML document on the result port. So I think that Calabash should probably raise an error if my stylesheet fails to produce a primary result document. (I remember that @xml-project mentioned that his processor will report this as an error.)

Copy link

@ndw ndw commented Apr 1, 2019

That certainly wasn’t an intentional change and I agree an error should be raised. Will see if I can fix it today.

Copy link

@ndw ndw commented Apr 3, 2019

Right. I've made progress using the RawDestination that Michael Kay suggested. It passes the obvious test but fails seven tests in regression. Will investigate and (hopefully) have patch tomorrow.

ndw added a commit that referenced this issue Apr 3, 2019
Copy link

@ndw ndw commented Apr 3, 2019

Fixed, I believe. 1.1.26-99 is available here and will be available in Maven shortly.

@ndw ndw closed this Apr 3, 2019
Copy link
Contributor Author

@gimsieke gimsieke commented Apr 4, 2019

Thanks, it now behaves as it did before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants