Re: Passing options from the command-line

On 31 August 2011 17:32, Norman Walsh wrote:
> Florent Georges writes:

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

> Very. Can you give an example of a string that has an EBV of
> true that Calabash interpretes as "false"?

  Anyone, say "hello":

> cat empty-option.xproc
<?xml version="1.0" encoding="UTF-8"?>
<p:pipeline xmlns:p="http://www.w3.org/ns/xproc" version="1.0">

   <p:option name="opt"/>

   <p:choose>
      <p:when test="p:value-available('opt')">
         <p:identity>
            <p:input port="source">
               <p:inline>
                  <when/>
               </p:inline>
            </p:input>
         </p:identity>
      </p:when>
      <p:otherwise>
         <p:identity>
            <p:input port="source">
               <p:inline>
                  <otherwise/>
               </p:inline>
            </p:input>
         </p:identity>
      </p:otherwise>
   </p:choose>

</p:pipeline>

> calabash empty-option.xproc opt=hello
Aug 31, 2011 5:56:43 PM com.xmlcalabash.util.DefaultXProcMessageListener info
INFO: Running pipeline !1
Aug 31, 2011 5:56:43 PM com.xmlcalabash.util.DefaultXProcMessageListener info
INFO: Running identity !1.2.2.1

                  <otherwise/>

>

-- 
Florent Georges
http://fgeorges.org/
http://h2oconsulting.be/

Received on Wednesday, 31 August 2011 15:59:32 UTC