Re: XProc questions from my students

"Costello, Roger L." <costello@mitre.org> writes:
> This week I am teaching a 3-day class on XProc. The students have
> asked several questions that I was unable to answer:

Lots of good answers, but here's my two cents.

> 1. Why do some steps have a primary output port, while others do not?
> For example, why is p:store's result output port not primary?

The primary output ports make it convenient to tie steps in a linear
sequence. Most steps take a document (or sequence of documents),
perform some process, and return the modified document(s). It makes
sense to chain these together.

Other steps, like p:store, take a document and return something else
entirely (in the case of p:store, the URI of the location where the
document was stored).

If you stick a p:store in the middle of a sequence, odds are good you
aren't going to get the result you expected. So by making the output
port not-primary, the pipeline author is forced to be explicit about
the bindings desired.

On balance, this is supposed to help more than hinder.

> 2. Why is it an error to include p:output in an atomic step?

Connecting inputs to outputs or outputs to inputs are equivalent. But
if we let you do both, then you could make conflicting statements. So
we only let you do one. That one happens to be inputs.

> 3. Are transactions possible? That is, is it possible to specify "The
> following steps must complete in entirety. If that's not possible then
> the state should be as it was before the steps started."

The standard language doesn't have this ability. It may be something
we need to add in the future, but let's let a few implementors figure
it out first ;-)

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | What is familiar is what we are used
http://nwalsh.com/            | to; and what we are used to is most
                              | difficult to 'Know'--that is, to see as
                              | a problem; that is, to see as strange,
                              | as distant, as 'outside us'.-- Nietzsche

Received on Wednesday, 20 May 2009 22:32:26 UTC