[prev in list] [next in list] [prev in thread] [next in thread] 

List:       velocity-user
Subject:    Re: What's the right way to do this?
From:       "Nathan Bubna" <nbubna () gmail ! com>
Date:       2009-01-06 16:28:04
Message-ID: 4d651da50901060828sa28b0f5h5cb368866d1127b3 () mail ! gmail ! com
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic