Re: Announce: XML Calabash 0.9.11

Philip Fennell <Philip.Fennell@bbc.co.uk> writes:

>> Updated <p:error> to include output port.
>
> So how does that work then?
>
> When using Calabash 0.9.10 the following fragment would raise an
> exception if the env option's value was not one of the prescribed
> values:
>
> <p:when test="not($env = ('sandbox', 'int', 'test', 'stage', 'live'))">
> 	<p:output port="result">
> 		<p:inline>
> 			<error/>
> 		</p:inline>
> 	</p:output>
> 	<p:error code="wadl:envRequirementFailed">
> 		<p:input port="source">
> 			<p:inline>
> 				<message>The option value provided does
> not match one of ('sandbox'|'int'|'test'|'stage'|'live').</message>
> 			</p:inline>
> 		</p:input>
> 	</p:error>
> </p:when>
>
> Error  : Pipeline failed: err:wadl:envRequirementFailed:
> The option value provided does not match one of
> ('sandbox'|'int'|'test'|'stage'|'live').
> Unknown error
>
> However, now with Calabash 0.9.11 I get:
>
> Error  : Pipeline failed: com.xmlcalabash.core.XProcException: No
> outputs allowed.
>
> In order to avoid the above error, I must wrap the step that raises the
> exception in a try/catch. Assuming that this is the correct behaviour
> then this needs to be made clear with a complete example in the
> recommendation.

Try this:

 <p:when test="not($env = ('sandbox', 'int', 'test', 'stage', 'live'))">
   <p:error code="wadl:envRequirementFailed">
 		<p:input port="source">
 			<p:inline>
 				<message>The option value provided does
 not match one of ('sandbox'|'int'|'test'|'stage'|'live').</message>
 			</p:inline>
 		</p:input>
 	</p:error>
 </p:when>

We added an output to p:error so that you wouldn't have to do all that
mucking around with a bogus output port from the p:when or p:otherwise.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | Nothing will ever be attempted, if all
http://nwalsh.com/            | possible objections must be first
                              | overcome.--Dr. Johnson

Received on Tuesday, 23 June 2009 12:51:38 UTC