Something like this:

<!-- Use attribute fbar for simple "fbar : x" if present.
     Use fbar: { ..} if only one contained tag,
     Use fbar : [ ... ] if more than one contained tag
-->
<def tag="ext-FooterBar">
  fbar:
  <if test="&fbar"><%= fbar %></if>
  <if test="&if parameters.default.size == 1"><ext-object
param="default"/></if>
  <if test="&if parameters.default.size > 1"><ext-array
param="default"/></if>
  <%= "," if !last_item? %>
</def>

<def tag="ext-items">
  items:
  <if test="&items"><%= items %></if>
  <if test="&if parameters.default.size == 1"><ext-object
param="default"/></if>
  <if test="&if parameters.default.size > 1"><ext-array
param="default"/></if>
  <%= "," if !last_item? %>
</def>

<def tag="ext-array">
[ <do param="default"/> ]
<%= "," if last_item? %>
</def>


<def tag="ext-object">
{ <do param="default"/> }
<%= "," if last_item? %>
</def>

--

But this approach also seems to lead to a lot of duplication, not very
DRY! What should I do to make it DRY?

Kristian

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