Re: Use optional options...

good point, I believe this is on WG radar, in
http://www.w3.org/TR/xproc-v2-req/, but may need a separate entry to
clarify explicitly.

thx, J



On 18 February 2014 09:48, Jostein Austvik Jacobsen <josteinaj@gmail.com> wrote:
> Well, I don't think it's always that easy. You can't currently dynamically
> choose whether or not to use the default value in a consise and easy way.
> Matthieu describes this in more detail in the thread "result of A&Q at XML
> Prague preconf day". See his point #3: "Conditional options".
>
>
>
>
> Jostein
>
>
> On 18 February 2014 09:26, Florent Georges <fgeorges@fgeorges.org> wrote:
>>
>>    Yes, Erik Siegel already answered me, just seen it was in private.
>> My brain obviously was not working 100% yesterday night...  Rule of
>> thumb: sleep on such questions when you work late at night, before
>> sending them on a public mailing list.
>>
>>   Thanks, and sorry for the noise,
>>
>> --
>> Florent Georges
>> http://fgeorges.org/
>> http://h2oconsulting.be/
>>
>>
>> On 18 February 2014 08:58, James Fuller wrote:
>> > you could provide a default value to the option ( look up 5.7.2
>> > p:option in http://www.w3.org/TR/xproc/#p.option)
>> >
>> >     <p:option name="o" required="false" select="()"/>
>> >
>> > maybe this does not address your need, but thought I would mention it.
>> >
>> > hth, Jim Fuller
>> >
>> >
>> > On 18 February 2014 01:07, Florent Georges <fgeorges@fgeorges.org>
>> > wrote:
>> >>   Hi,
>> >>
>> >>   If I pass an optional option to a step, and if I want to use the
>> >> value of the parameter, without any error because that parameter does
>> >> not exist, I would like to declare the following variable (to default
>> >> the value of the option in case it has not been provided, and to
>> >> prevent static errors), but even in that case it is an error because
>> >> the variable is referenced in the XPath expression, so it is a static
>> >> error:
>> >>
>> >>     <p:option name="o" required="false"/>
>> >>
>> >>     <p:variable name="v" select="
>> >>        if ( p:value-available('o') ) then
>> >>           $o
>> >>        else
>> >>           'default value'"/>
>> >>
>> >>     <!-- here, can use $v everywhere... -->
>> >>
>> >>   Is there an idiomatic solution to this problem?  I mean, besides
>> >> using a p:choose around all possible step using the option?
>> >>
>> >>   Regards,
>> >>
>> >> --
>> >> Florent Georges
>> >> http://fgeorges.org/
>> >> http://h2oconsulting.be/
>> >>
>>
>

Received on Tuesday, 18 February 2014 09:09:03 UTC