XProc Unit Test: head001

Inputs

Port=source:

<p:pipeline name="pipeline" xmlns:p="http://www.w3.org/2007/03/xproc">
<p:input port="source"/>
<p:output port="result"/>

<p:identity>
  <p:input port="source">
    <p:pipe step="pipeline" port="source"/>
    <p:pipe step="pipeline" port="source"/>
    <p:pipe step="pipeline" port="source"/>
  </p:input>
</p:identity>

<p:head>
  <p:option name="count" value="2"/>
</p:head>

<p:count/>

</p:pipeline>

Pipeline

pipeline:

<p:pipeline name="pipeline" xmlns:p="http://www.w3.org/2007/03/xproc">
<p:input port="source"/>
<p:output port="result"/>

<p:identity>
  <p:input port="source">
    <p:pipe step="pipeline" port="source"/>
    <p:pipe step="pipeline" port="source"/>
    <p:pipe step="pipeline" port="source"/>
  </p:input>
</p:identity>

<p:head>
  <p:option name="count" value="2"/>
</p:head>

<p:count/>

</p:pipeline>

Outputs

Port=result:

<c:result xmlns:c="http://www.w3.org/2007/03/xproc-step">2</c:result>