| Issue 69: | Clarification required: How does XProc handle XSLT transforms with multiple outputs? | |
| 1 person starred this issue and may be notified of changes. | Back to list |
I'm trying to include an XSLT transform with multiple outputs as the last step of a pipeline (my objective being to have all these outputs saved as the final result of the pipeline). But I'm unable to infer from the recommendation how these outputs might be handled within Xproc. So far all my trials have invariably ended with a "Pipeline failed: java.lang.NullPointerException" error message! |
|
,
Oct 04, 2009
If you post a sample that produces NullPointerException, I'll try to fix it. Secondary results appear on the 'secondary' port. If you want those to be stored on disk, you have to write them with p:store.
Status: Accepted
|
|
,
Oct 05, 2009
Here's a sample that produces NullPointerException:
Source file :
<document>
<section>
<title>Object</title>
</section>
<section>
<title>Application Domain</title>
</section>
</document>
XSLT stylesheet:
<xsl:stylesheet
version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:for-each select="//document//section">
<xsl:result-document href="chap{position()}.xml">
<document>
<xsl:copy-of select="*"/>
</document>
</xsl:result-document>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
XProc pipeline:
<p:declare-step name="splitting" xmlns:p="http://www.w3.org/ns/xproc" >
<p:input port="source"/>
<p:input port="parameters" kind="parameter"/>
<p:xslt name="splitter">
<p:input port="stylesheet" >
<p:document href="split.xsl"/>
</p:input>
</p:xslt>
<p:store>
<p:with-option name="href" select="'result1.xml'"/>
</p:store>
<p:store>
<p:input port="source">
<p:pipe step="splitter" port="secondary"/>
</p:input>
<p:with-option name="href" select="'result2.xml'">
<p:empty/>
</p:with-option>
</p:store>
</p:declare-step >
|
|
|
|