velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Dutcher" <djdutche...@earthlink.net>
Subject Foreach syntax and whitespace
Date Sat, 06 Jul 2002 17:12:32 GMT
Hello,

I'm using Velocity to generate some html, and I have a script like this:

#foreach($email in$email_list)
<p>$email</p>
#end

And it works great, but I am trying to enter the VTL directly into a WYSIWYG
html editor.  Maybe I will have to edit the html file once the editor is
done with it, but I'd like to avoid that so I don't have to re-edit the html
file everytime I change something with the editor.  Sometimes though the
editor will end up splitting the foreach line like this:

#foreach($email
in$email_list)
<p>$email</p>
#end

Then when I try to merge the html file with a VelocityContext I get an
exception.

I tried doing this:
#foreach($(email)in$email_list)

but that didn't work either.  It seems that Velocity needs a space, (not a
CR/LF) between $email and in and nothing else will work.  Is that true, or
is there something I'm missing?

Thanks,

Dave


--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message