W3C home > Mailing lists > Public > xproc-dev@w3.org > May 2012

Re: Conditional Logic . . . what am I missing?

From: Romain Deltour <rdeltour@gmail.com>
Date: Wed, 2 May 2012 00:41:20 +0200
Cc: xproc-dev@w3.org
Message-Id: <7A2200D5-7893-45C1-8B60-C733175EE66D@gmail.com>
To: Christopher.R.Ball <christopher.r.ball@gmail.com>
I don't think you're overlooking something. The p:choose with an identity in the otherwise branch is a common pattern.

Romain.

On 1 mai 2012, at 22:51, Christopher.R.Ball wrote:

> I need to conditionally include an element in a pipeline and was rather surprised that my only option is to use <p:choose>.
> 
> I would have thought I should be able to use 'use-when' but that seems to only take static values (which makes me wonder about what it is for).
> 
> So I am having to use this:
> 
>   <p:choose>
>   <p:when test="$informative-matches = 0">
>   <p:insert match="entity/other-searches" position="last-child">
>   <p:input port="insertion" select="/entity/music-search"/>
>   </p:insert>
>   </p:when>
>   <p:otherwise>
>   <p:identity/>
>   </p:otherwise>
>   </p:choose>
> 
> 
> When all I really want is this:
> 
> 
>   <p:insert match="entity/other-searches" position="last-child"
>   use-when"$informative-matches = 0">
>   <p:input port="insertion" select="/entity/music-search"/>
>   </p:insert>
> 
> Hopefully, I am overlooking something obvious ;)
> 
> Regards,
> 
> Christopher
> 
Received on Tuesday, 1 May 2012 22:41:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 1 May 2012 22:41:54 GMT