Previous Up Next


p:sink — Discards its input.


<p:declare-step type="p:sink">
     <p:input port="source" sequence="true"/>


The p:sink step accepts a sequence of documents and discards them. It has no output.

This is valuable when you want to ignore the primary output of some step (perhaps because you only care about one of its secondary outputs or you are relying on some side-effect that it has).


There's nothing much to show, really, p:sink is just a bit bucket. In this example, we explicitly discard the primary output of the p:xslt step and return only the content of its secondary output.

  1 <p:pipeline xmlns:p=""
      <p:xslt name="style">
  5     <p:input port="stylesheet">
            <xsl:stylesheet xmlns:xsl=""
              <xsl:template match="/">
 10             <xsl:sequence select="."/>
                <xsl:result-document href="">
                    <p>Secondary result document.</p>
 15             </xsl:result-document>
 20   </p:xslt>
 25     <p:input port="source">
          <p:pipe step="style" port="secondary"/>
Input Output
1 <doc>
<para>Hello world.</para>
1 <doc>
<p>Secondary result document.</p>

Without the p:sink, the XProc processor would have complained about the unbound primary output port on the p:xslt step.