velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nbu...@gmail.com>
Subject Re: What's the right way to do this?
Date Tue, 06 Jan 2009 16:28:04 GMT
There are no general escaping provisions, and even w/o the close
parenthesis, you would need to put quotes around it.  Can't just put
random content in the RHS of a #set directive.  For an interpolated
string, wrap in ", for a non-interpolated string, wrap in '.
Escaping with \ is only for valid references, directives and
velocimacros.

#set( $text = "$velocityCount) $field.getPaddedLabel($Language):
$Fields.get($field)" )

On Tue, Jan 6, 2009 at 6:28 AM, Steve Cohen <stevecoh1@comcast.net> wrote:
> Here's the wrong way:
>
> #set ( $text =$velocityCount\) $field.getPaddedLabel($Language):
> $Fields.get($field))
> The intent here is to produce a string like
>
> 3)    City: Chicago
>
> with a close-paren after the number.
>
> But velocity is complaining about that close parenthesis that I thought I
> was handling via escaping.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

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


Mime
View raw message