RE: calabash / xsl:result-document

> I had the same problem.  If you let XProc handle writing(p:write) the
> XML file instead of the XSLT then it worked.  I have to admit it is a
> little simpler to use <xsl:result-document>.
> 
> For complex chunking of documents I suspect using XProc for writing
> the chunking mechanisms could be painful.

Maybe, maybe not. The documents carry the correct base URIs (as specified in xsl:result-document and/or using the output-base-uri option), so you can do things like this:

<p:xslt name="xslt">...</p:xslt>
<p:for-each>
  <p:iteration-source>
    <p:pipe step="xslt" port="result"/>
    <p:pipe step="xslt" port="secondary"/>
  </p:iteration-source>
  <p:store>
    <p:with-option name="href" select="p:base-uri()"/>
  </p:store>
</p:for-each>

The pipeline above iterates over all documents produced by the stylesheet (both primary and the ones created using xs:result-document) and saves them to the correct output locations. The advantage is that you can also do something else if you want.

Regards,
Vojtech

--
Vojtech Toman
Consultant Software Engineer
EMC | Information Intelligence Group
vojtech.toman@emc.com
http://developer.emc.com/xmltech

Received on Thursday, 2 December 2010 12:29:31 UTC