You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Dave Hallam <sn...@googlemail.com> on 2007/03/15 17:11:35 UTC

Escaping . in template

Hi,

I have a template that contains the following:

$foo.bar

The variable is foo.  The ".bar" bit is just text so if $foo = hello, the
rendered output should say

hello.bar

I've tried using \ but to no avail by doing

$foo\.bar

The output I get there is

hello\.bar

Can anyone help?

Many thanks,

Dave

Re: Escaping . in template

Posted by Dave Hallam <sn...@googlemail.com>.
Brilliant

Thanks

On 15/03/07, Nathan Bubna <nb...@gmail.com> wrote:
>
> use formal notation:
>
> ${foo}.bar
>
> On 3/15/07, Dave Hallam <sn...@googlemail.com> wrote:
> > Hi,
> >
> > I have a template that contains the following:
> >
> > $foo.bar
> >
> > The variable is foo.  The ".bar" bit is just text so if $foo = hello,
> the
> > rendered output should say
> >
> > hello.bar
> >
> > I've tried using \ but to no avail by doing
> >
> > $foo\.bar
> >
> > The output I get there is
> >
> > hello\.bar
> >
> > Can anyone help?
> >
> > Many thanks,
> >
> > Dave
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

Re: Escaping . in template

Posted by Nathan Bubna <nb...@gmail.com>.
use formal notation:

${foo}.bar

On 3/15/07, Dave Hallam <sn...@googlemail.com> wrote:
> Hi,
>
> I have a template that contains the following:
>
> $foo.bar
>
> The variable is foo.  The ".bar" bit is just text so if $foo = hello, the
> rendered output should say
>
> hello.bar
>
> I've tried using \ but to no avail by doing
>
> $foo\.bar
>
> The output I get there is
>
> hello\.bar
>
> Can anyone help?
>
> Many thanks,
>
> Dave
>

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