Output ports

/ Jeni Tennison <jeni@jenitennison.com> was heard to say:
| 13. Section 4.2.13 (p:declare-component Element), the last paragraph says:
|
|   "The input and parameter declarations of a p:declare-component may use
|    the name "*" to indicate that the component accepts an arbitrary
|    number of inputs, outputs, or parameters."
|
| Is "*" allowed on output declarations too? If it is, then the
| paragraph should say:
|
|   "The input, output, and parameter declarations of a
|    p:declare-component may use the name "*" to indicate that the
|    component accepts or provides an arbitrary number of inputs, outputs,
|    or parameters."
|
| If not, then it should say:
|
|   "The input and parameter declarations of a p:declare-component may use
|    the name "*" to indicate that the component accepts an arbitrary
|    number of inputs or parameters."

Right. I had originally writtent the former, but at the last telcon,
there was pushback to the idea of allowing an arbitrary number of
output ports. The only component that we could think of that would use
this functionality was p:tee.

The crux of the problem is that we don't allow p:output elements (we don't
even *have* p:output elements anymore) on steps. So you can say:

  <p:step name="fork" component="p:tee">
    <p:input port="document">
      <mydoc/>
    </p:input>
  </p:step>

But how do downstream components "x" and "y" refer to the output of
p:tee? What port names does it have?

Having given this some more thought, I have a proposal. I think we
should allow p:output elements. For most components, they will have
to have fixed names:

  <p:step name="xform" component="p:xslt">
    <p:input port="document" .../>
    <p:input port="stylesheet" .../>
    <p:output port="result" .../>
  </p:step>

It would be an error to refer to any port other than "result" on a
p:xslt step. (And it would be ok to leave it out, it would be inferred
by the processor.)

But on a step declared like so:

  <p:declare-component component="p:tee">
    <p:declare-input port="document"/>
    <p:declare-output port="*"/>
  </p:declare-component>

the p:output elements cause the named ports to spring into existence:

  <p:step name="fork" component="p:tee">
    <p:input port="document">
      <mydoc/>
    </p:input>
    <p:output port="out"/>
    <p:output port="outheretoo"/>
  </p:step>

Why is this valuable?

1. It gives the author a place to hang extension elements on the output
   (for debugging, for example).

2. It allows the author to make explicit the outputs of steps.

3. It allows declare-output port="*" to work for p:tee and any other
   components that an implementor wants to invent with the semantic
   that they can produce an arbitrary number of outputs.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh
XML Standards Architect
Sun Microsystems, Inc.

Received on Wednesday, 23 August 2006 17:11:33 UTC