The <p:sink> step has only an input port (“source“). Everything being loaded into this port, is rejected. This may be reasonable for more complex processings if, for example, various interim results or parts of a document are not needed anymore. The step has no output port.
In the example the input file is read in at the input port and rejected by <p:sink>.
<?xml version="1.0" encoding="UTF-8"?> <p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0"> <p:input port="source"> <p:document href="FilmCollection.xml"/> </p:input> <p:output port="result"> <p:empty/> </p:output> <p:sink/> </p:declare-step>
A <p:empty> has to be declared in the primary output port (“result“) since otherwise a dynamic error would occur (a port must never be unbound).