RE: Test suite: err-s0004-005

> > You changed the following line in test err-s0004-005.xml:
> >
> > <p:option name="foo" select="'bar'" required="false"/>
> >
> > to:
> >
> > <p:option name="foo" select="'bar'"/>
> >
> > with an SVN comment: "The required option isn't allowed if you
specify
> > select".
> >
> > The thing is, the @required attribute was set to false, so @select
> > should be allowed in that case. I think that if Calabash was failing
the
> > original test, then it was because of a bug, not because the test
was
> > wrong.
> 
> Actually, Calabash didn't have any trouble (which is a bug, but not
> one I've bothered to fix just yet :-( ), but the pipeline wasn't valid
> according to the RELAX NG grammar for pipelines. In 5.7.2 you'll see
> that the required attribute isn't allowed when select is used.
> 
> We could change that so that it's allowed if and only if it's set to
> false, but I'm not sure it's worth the effort.

Why is this so difficult to change? We already do something similar with
parameter input ports: if p:input/@kind="parameter", it is static error
err:XS0040 to set @sequence to anything than "true".

I don't see any reason why we can't do the same with p:option/@required
and @select. The relationship between @required and @select does not
need to be handled in the schema at all; just leave it to the
implementation to report err:XS0004 if @required="true" and @select is
specified.

Regards,
Vojtech

Received on Tuesday, 23 February 2010 13:06:33 UTC