Re: defaulting

Henry S. Thompson wrote:
> Jeni Tennison writes:
>> Richard & Henry wrote:
>>>   The default input of a step is bound to the default readable port if
>>>   it is not otherwise bound;
>>>   Non-default inputs are only bound to the default readable port if
>>>   you call for that to happen by writing
>>>    <p:input port="not-the-default-input-port"/>
>> The other option would be to say that all inputs are bound to the
>> default readable port if they're not explicitly bound, such that
>>
>> <p:pipeline>
>>   <p:xslt1 />
>> </p:pipeline>
>>
>> accepts an XSLT stylesheet input and runs it on itself (this is
>> actually something I do quite a lot).
>>
>> It would make the defaulting story slightly easier to specify, since
>> an omitted input would *always* be equivalent to an empty <p:input>
>> element for that port.
>>
>> Is there any reason not to do that?
> 
> Yes.  Consider
> 
>  <p:pipeline>
>   <p:validate-xml-schema/>
>  <p:pipeline>
> 
> I want that to validate based on what it finds in the document, not
> try to use it as a schema to validate itself.

Ah right, so you expect non-default <p:input>s that are unbound to 
default to an empty sequence. (And therefore generate a (static) error 
if they're not declared to accept a sequence.)

I don't violently object to that; it just wasn't specified in the proposal.

For the record, I think it would be worthwhile for the spec to note that 
steps declared with <p:declare-step> *don't* have any inputs or outputs 
auto-declared.

>> Also, I'm assuming that the default readable port after a given step
>> would be the default output of the previous step (in document order)?
> 
> Yes, that's already true.

So it is.

Jeni
-- 
Jeni Tennison
http://www.jenitennison.com

Received on Friday, 22 June 2007 20:13:03 UTC