Re: Cardinality of inputs

/ Innovimax SARL <innovimax@gmail.com> was heard to say:
| Seems even less strange because I proposed something like
| http://lists.w3.org/Archives/Public/public-xml-processing-model-wg/2007May/0307.html

Oops. Sorry I forgot that. I created the wiki tracking page to
compensate for my poor memory :-)

| (replace optional by required)
|
| but what bother's me is
|
|>     yes          no       One or more documents
|
| that is a sequence by default (because 'no' is the default for
| @optional) is 1 or more
[...]
|> This breaks out as follows:
|>
|>   Sequence    Optional    Input accepts         
|>   --------    --------    -------------         
|>     no           no       Exactly one document  
|>     yes          no       One or more documents 
|>     no           yes      Zero or one documents 
|>     yes          yes      Zero or more documents
|>
|> I think the default, in both cases, should be "no".

I see your point, but I can't think of a way to express the
sequence/optional semantics independently with the results you want.

If we say that the default for optional is 'no' then

  <p:input port="name" sequence='yes'/>

has the semantics of "1 or more" where "0 or more" might be preferred.

If we say that the default for optional is 'yes' then the sequence
case is better, but:

  <p:input port="name"/>

has the semantics of "0 or 1" where "exactly 1" might be preferred.

Personally, I think that sequences of zero documents are going to be
uncommon so I'd prefer that the latter case mean "exactly 1" even if
it means that the user has to specify two attributes to get "0 or
more" semantics.

One alternative is to make the value of "optional" conditional on the
value of "sequence" but I think that will be very confusing.

The other alternative I see is:

  Cardinality   Input accepts         
  -----------   -------------         
  exactly-one   Exactly one document  
  zero-or-one   Zero or one documents 
  zero-or-more  Zero or more documents
  one-or-more   One or more documents 

Maybe that's the better answer, I just think that the attribute name
"cardinality" is awfully technical. And I can't think of a better
name.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | There is no such thing as an absolute
http://nwalsh.com/            | certainty, but there is assurance
                              | sufficient for the purposes of human
                              | life.--John Stuart Mill

Received on Tuesday, 5 June 2007 14:23:28 UTC