W3C home > Mailing lists > Public > xproc-dev@w3.org > August 2011

Re: Passing options from the command-line

From: Norman Walsh <ndw@nwalsh.com>
Date: Sat, 27 Aug 2011 14:22:45 -0400
To: XProc Dev <xproc-dev@w3.org>
Message-ID: <m2y5yeg1e2.fsf@nwalsh.com>
Florent Georges <fgeorges@fgeorges.org> writes:
>   1/ if I evaluate it without passing any option explicitely,
>      then the output would be <otherwise/>

No. That'll give you an error because you're referring to a variable
with no value. If you want to test for that condition, use

  p:value-available('opt')

>   2/ if I evaluate it passing $opt as an empty string, then the
>      output would be <otherwise/>

Yes.

>   3/ if I evaluate it passing any non-zero-length string for
>      $opt, then the output would be <when/>

No. The result depends on the effective boolean value of the string.
So 'false' and possibly other values (I don't recall the EBV rules
for string off the top of my head) would give you <otherwise/>.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh
Lead Engineer
MarkLogic Corporation
Phone: +1 413 624 6676
www.marklogic.com

Received on Saturday, 27 August 2011 18:23:13 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 27 August 2011 18:23:13 GMT