W3C home > Mailing lists > Public > xproc-dev@w3.org > June 2009

RE: Announce: XML Calabash 0.9.11

From: Philip Fennell <Philip.Fennell@bbc.co.uk>
Date: Tue, 23 Jun 2009 14:22:25 +0100
Message-ID: <F3685F4A877F284F8054E328390447D14C6EB1@bbcxues17.national.core.bbc.co.uk>
To: "XProc Dev" <xproc-dev@w3.org>
Norm,

When I tried that first time I didn't realise I needed to remove the
p:output from the p:otherwise too.


Many thanks.

Philip Fennell


-----Original Message-----
From: xproc-dev-request@w3.org [mailto:xproc-dev-request@w3.org] On
Behalf Of Norman Walsh
Sent: 23 June 2009 13:51
To: XProc Dev
Subject: 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

http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.
					
Received on Tuesday, 23 June 2009 13:23:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 23 June 2009 13:23:02 GMT