Page 1 of 1
xproc and xsl:result-document
Posted: Thu Oct 31, 2013 1:20 pm
by E.F.Gramsbergen
Hello,
I have a pipeline where one of the xslt's must produce secondary output documents through xsl:result-document. I would expect to see these documents produced as a 'side effect' of the transformation. However, they are not. When I bind the secondary output port of the xslt step to an output port of the pipeline, I do get the secondary outputs in the result pane but they are not stored as files. I tried with relative and absolute uris in the xsl:result-document/@href. Both work when I run the xslt outside xproc.
The number of secondary output files and the file names are not known in advance; they are determined by the xslt.
I found one item on a Calabash forum saying that xsl:result-document makes files as expected, so I think that this is not a pure Calabash issue but a Calabash-within-oXygen issue.
I may have missed something simple as a newbie to oXygen.
Any help much appreciated,
Egbert Gramsbergen.
Re: xproc and xsl:result-document
Posted: Fri Nov 01, 2013 1:58 pm
by Radu
Hi Egbert,
I created some small samples:
XML document "personal.xml":
XSL document "personal.xsl"
Code: Select all
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:template match="/">
<xsl:result-document href="file:/D:/test.xml">
<abc/>
</xsl:result-document>
<root/>
</xsl:template>
</xsl:stylesheet>
and XProc document "transform.xpl":
Code: Select all
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" version="1.0">
<p:input port="source">
<p:document href="personal.xml"/>
</p:input>
<p:output port="result"/>
<p:xslt>
<p:input port="source"/>
<p:input port="stylesheet">
<p:document href="personal.xsl"/>
</p:input>
<p:input port="parameters">
<p:empty/>
</p:input>
</p:xslt>
</p:declare-step>
From what I tested both when run from Oxygen or from the command line the result document is not written in the place specified by the reference.
A command line for running Calabash can be invoked (in Windows at least) with something like:
Code: Select all
java -cp "lib\xproc\calabash\calabash.jar;lib\saxon9ee.jar;lib\httpclient-4.2.5.jar" com.xmlcalabash.drivers.Main samples/xproc/transform.xpl
where the current directory is the directory where Oxygen is installed.
This looks like a bug in Calabash, should I try to start a discussion about this on the XProc users list?
Regards,
Radu
Re: xproc and xsl:result-document
Posted: Fri Nov 01, 2013 3:03 pm
by Radu
Hi,
Actually the issue is discussed here:
http://lists.w3.org/Archives/Public/xpr ... /0003.html
Regards,
Radu
Re: xproc and xsl:result-document
Posted: Fri Nov 01, 2013 4:41 pm
by E.F.Gramsbergen
So it seems that this is a bug that is already known for 3 years. Is there any chance that it will be resolved in the near future?
Re: xproc and xsl:result-document
Posted: Fri Nov 01, 2013 5:05 pm
by Radu
Hi,
I found another thread here:
http://lists.w3.org/Archives/Public/xpr ... /0000.html
and actually this does not look like a bug, I looked into the XProc specification:
http://www.w3.org/TR/xproc/
which states:
The XSLT stylesheet provided on the stylesheet port is applied to the document on the source port. Any parameters passed on the parameters port are used to define top-level stylesheet parameters. The primary result document of the transformation appears on the result port. All other result documents appear on the secondary port. If XSLT 1.0 is used, an empty sequence of documents must appear on the secondary port.
So you are not the only one who does not like this behavior (it seemed strange to me too) but it seems to behave like the specification says it should.
Regards,
Radu
Re: xproc and xsl:result-document
Posted: Fri Nov 01, 2013 9:18 pm
by E.F.Gramsbergen
Ah well, I read this part too and I thought ik meant that the secondary documents would appear on the secondary port and be stored on the location specified in the xslt because that's what it is supposed to do according to the xslt specification.
Anyhow, thanks for clearing this up. I guess I can work around this with a simplified xslt, p:for-each, p:store and a bit of creativity.