I'm not sure I agree.  That would imply that else blocks should behave
the same way:

  <if>
    first
  <else/>
    other
  </if>

VoiceXML does that.  I actually like Hobo's separate else tags so they
can be used after repeats, etc.

<repeat:models>...</repeat>
<elsif:name>It has a name</elsif>
<else>No info for you!</else>

Just personal opinion of course.


On Wed, Mar 11, 2009 at 9:00 PM, kevinpfromnm <[email protected]> wrote:
>
> If it was added I'd suggest that maybe a self closing tag would be
> cleaner syntax.  Leading to code like this:
> <if>
>  first if true
> <elsif condition />
>  first elsif true
> <elsif condition />
>  first elsif false, second true
> <elsif condition />
>  etc.
> </if>
> <else>...
>
> Not sure how this would work with existing dryml code.  Might be
> relatively simple if all <if> tags content is always in a block.  An
> elsif then just becomes a close previous block, elsif condition, open
> new block.
>
> On Mar 11, 5:41 pm, Scott Bronson <[email protected]> wrote:
>> That's true.  Erb is a good fallback.
>>
>> I gues my question is, if Hobo has <if> and <else>, why doesn't it have 
>> <elsif>?
>>
>> On Wed, Mar 11, 2009 at 3:46 PM, kevinpfromnm <[email protected]> wrote:
>>
>> > Probably be simpler to just use erb for these edge cases with elsif or
>> > a case statement as appropriate.  That or a view helper.
>>
>> > On Mar 11, 1:45 pm, Scott Bronson <[email protected]> wrote:
>> >> I rarely use the if tag, usually preferring to put conditionals into 
>> >> attributes.
>>
>> >> Today, though, I have a whole bunch of alternatives that I need to test.
>>
>> >> <if test="&this.complete?">
>> >>    <view ...>
>> >> </if><else>
>> >>   <if test="&this.confirmed?">
>> >>     <view ...>
>> >>   </if><else>
>> >>     <if test="&this.pending?">
>> >>       <view...>
>> >>     </if><else>
>> >>       <if test="&this.active?">
>> >>         <view ...>
>> >>       </if><else>
>> >>         Unknown
>> >>       </else>
>> >>     </else>
>> >>   </else>
>> >> </else>
>>
>> >> Not so pretty.  Would it make sense to add an elsif tag to dryml core?
>>
>> >> <if test="&this.complete?">
>> >>    <view ...>
>> >> </if><elsif test="&this.confirmed?">
>> >>   <show ...>
>> >> </elsif><elsif test="&this.pending?">
>> >>   <other...>
>> >> </elsif><elsif test="&this.active?">
>> >>   <stuff ...>
>> >> </elsif><else>
>> >>   Unknown
>> >> </else>
>>
>> >> Or is there a better way to write this in dryml?
>>
>> >> (I know, I know, use polymorphic tags...  in this case, it would
>> >> actually make things more obscure)
>>
>> >>    - Scott
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to