personally, my recommendation would be to ditch the escaping rules for
variables and go with the following:

#set( $D = '$' )
${D}myVar

or you can add the new EscapeTool (in VelocityTools 1.2-rc1) to your
context and do:

${esc.d}myVar

escaping is really a pain if you aren't sure whether a variable will
be there or not.  i haven't done it to generate another velocity
template, but the thought is unpleasant. :)

On 10/27/05, Ahmed Mohombe <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Is there a best practice on how to escape a velocity template.
> (so in order to generate another velocity template?).
>
> The escaping rules are clear however it seems a nightmare to me
> to apply them because of the fact that 'undefined' variables are threated
> different by the escape rule.
>
> The problem is that some variables exist both in the source and the target 
> template.
> At the moment I tried so many 'tweakings' and I never get what I expect.
> I'm at the point to use another template engine to generate velocity 
> templates,
> just to avoid the escaping nightmare.
>
> Thanks in advance,
>
> Ahmed.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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

Reply via email to