xproc and xsl:result-document
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 3
- Joined: Thu Oct 31, 2013 12:11 pm
xproc and xsl:result-document
Post 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.
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.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: xproc and xsl:result-document
Hi Egbert,
I created some small samples:
XML document "personal.xml":
XSL document "personal.xsl"
and XProc document "transform.xpl":
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:
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
I created some small samples:
XML document "personal.xml":
Code: Select all
<root/>
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>
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>
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
This looks like a bug in Calabash, should I try to start a discussion about this on the XProc users list?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: xproc and xsl:result-document
Hi,
Actually the issue is discussed here:
http://lists.w3.org/Archives/Public/xpr ... /0003.html
Regards,
Radu
Actually the issue is discussed here:
http://lists.w3.org/Archives/Public/xpr ... /0003.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 3
- Joined: Thu Oct 31, 2013 12:11 pm
Re: xproc and xsl:result-document
Post 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?
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: xproc and xsl:result-document
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:
Regards,
Radu
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:
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.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.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 3
- Joined: Thu Oct 31, 2013 12:11 pm
Re: xproc and xsl:result-document
Post 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.
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.
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service