Hi,

Given that my templates must exist in a well-formed XML document, I was wondering if velocity had a mechanism to handle the following:

#if ($isChecked)
  <input ... checked="checked"/>
#else
  <input .../>
#end

Since I need well-formed markup I cannot do:

<input ... #if($isChecked)checked="checked"#end/>

?

Someone turned me on to PXTL (http://www.doxdesk.com/pxtl/), a python templating language built with XML in mind. In PXTL you would handle the above with:

<input ... checked="checked{?px_if isChecked?}"/>

In other words, if the test fails, the templating engine removes the checked attribute node while still allowing for well-formedness.

Anything like this in velocity?

thanks,
-Rob

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to