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

Re: Passing options from the command-line

From: Florent Georges <fgeorges@fgeorges.org>
Date: Sun, 28 Aug 2011 23:14:47 +0200
Message-ID: <CADyR_r0z4=_Abn70tKYZD+2h=SAGNv660e5aCmmgCvMV_XyHnQ@mail.gmail.com>
To: Norman Walsh <ndw@nwalsh.com>
Cc: XProc Dev <xproc-dev@w3.org>
On 27 August 2011 20:22, Norman Walsh wrote:
> Florent Georges 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')

  Yes, thanks.  Btw the error message Calabash gives is
"empty-option.xproc:7:27:err:XD0023:Undeclared variable in XPath
expression: $opt".  Maybe the "undeclared" is not exactly right.

>>   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/>.

  Yes, I simplified a bit for the sake of conciseness.  But
nontheless, whatever string I pass (with an EBV of true()), I get
always <otherwise/> instead of <when/>, except with the exact
strings "true" and "1".  Weird...

  Thanks for your response!  Regards,

Florent Georges
Received on Sunday, 28 August 2011 21:15:44 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:08 UTC