RE: XProc questions from my students

> >
> > 2. Why is it an error to include p:output in an atomic step?
> >
> 
> Your are allowed to use p:output in the "signature" of a step
> 
> When you use it, then connection is made by the steps that "reads
> from" this port

This is correct. In a compound step (p:for-each, p:viewport, ...), where
p:output is allowed, it can 'read from' the contained steps or inline or
external documents.

Atomic steps are different. They are blackbox-like things with no
internal structure (at least from the perspective of the caller). They
just perform some operation on the input data and produce some results
on their output ports. If p:output was allowed on atomic steps, it would
mean that you would be able to 'override' the step results, like this:

<p:count>
  <p:output port="result">
    <p:document href="somedoc.xml"/>
  </p:output>
</p:count>

(= execute the p:count step, but return somedox.xml instead of the usual
c:result document)

But what would be the point of that? If you really want to do something
like this, you can always use p:identity etc.

Regards,
Vojtech

Received on Wednesday, 20 May 2009 10:20:03 UTC