You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Park Walker <pa...@anchorsilk.com> on 2001/06/15 22:54:12 UTC
Template syntax question
Hi,
I've be trying to get velocity to output a pair of "/" characters at the
beginning of a line without success. This is actually being done in
Velocity, but this seemed to be the best place to ask the question. I can't
find anything in the doc or archives. It seems that it's treating the string
as a comment regardless of how it's produced. I've tried the following:
foo
//
bar
produces foo bar
#set($sep = "//")
foo
$sep
bar
produces foo bar
#set($sep = "/")
foo
/$sep
produces foo /$sep bar
#set($sep = "/")
foo
$sep/
produces foo bar
#set($sep = "/")
foo
$sep$sep
bar
produces foo /$sep bar
The problem I have is that SAP DB wants the // - at the beginning of a line
- as a statement separator.
Any thoughts?
Park
Re: Template syntax question
Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Somethings wacked, as it works for me. I can take the following
template :
--------
foo
//
bar
foo//bar
//foo//bar//
------
and the output is
--------
foo
//
bar
foo//bar
//foo//bar//
------
So lets start from the beginning -
What version of velocity?
Any special encoding of the template?
geir
Park Walker wrote:
>
> Hi,
>
> I've be trying to get velocity to output a pair of "/" characters at the
> beginning of a line without success. This is actually being done in
> Velocity, but this seemed to be the best place to ask the question. I can't
> find anything in the doc or archives. It seems that it's treating the string
> as a comment regardless of how it's produced. I've tried the following:
>
> foo
> //
> bar
> produces foo bar
>
> #set($sep = "//")
> foo
> $sep
> bar
> produces foo bar
>
> #set($sep = "/")
> foo
> /$sep
> produces foo /$sep bar
>
> #set($sep = "/")
> foo
> $sep/
> produces foo bar
>
> #set($sep = "/")
> foo
> $sep$sep
> bar
> produces foo /$sep bar
>
> The problem I have is that SAP DB wants the // - at the beginning of a line
> - as a statement separator.
>
> Any thoughts?
>
> Park
--
Geir Magnusson Jr. geirm@optonline.net
System and Software Consulting
Developing for the web? See http://jakarta.apache.org/velocity/
You have a genius for suggesting things I've come a cropper with!