You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Michael Wallstedt <Mi...@fbfs.com> on 2008/02/01 01:57:43 UTC
Suspecting Escape Sequence Bug
Hi,
I am trying to use Velocity to generate jrxml files for Jasper reports.
Unfortunately, jrxml has some syntax that's dangerously close to yours. In
my case I need a string like
$P{foo}.bar
to come through unmodified. When I try the straightforward approach, I get
some odd results
\$P{foo}.bar
gives me
\$P{.bar
and
$P{foo}.bar
gives me
$P{.bar
I've tried several variations, but the best I've managed is to get
$P\{foo}.bar
$P{}{foo}.bar
to come through unmodified.
I get the impression that velocity escapes tokens rather than individual
characters, and something in the logic that trys to accommodate tokenizing
when the {} may or may not be present doesn't handle my situation.
Any help with this is greatly appreciated.
- Mike Wallstedt
__________________________________________
The information contained in this message may be privileged and
confidential and protected from disclosure. If you are not the intended
recipient of this message, you are hereby notified that any dissemination,
distribution, or copying of this communication is strictly prohibited. If
you have received this communication in error, please notify us immediately
by replying to the message, and please delete it from your computer.
Re: Suspecting Escape Sequence Bug
Posted by Nathan Bubna <nb...@gmail.com>.
On Jan 31, 2008 4:57 PM, Michael Wallstedt <Mi...@fbfs.com> wrote:
>
>
> Hi,
>
> I am trying to use Velocity to generate jrxml files for Jasper reports.
> Unfortunately, jrxml has some syntax that's dangerously close to yours. In
> my case I need a string like
>
> $P{foo}.bar
>
> to come through unmodified. When I try the straightforward approach, I get
> some odd results
>
> \$P{foo}.bar
> gives me
> \$P{.bar
>
> and
>
> $P{foo}.bar
> gives me
> $P{.bar
yuck. that certainly looks like a bug. can you open a new JIRA issue for this?
http://issues.apache.org/jira/browse/VELOCITY
> I've tried several variations, but the best I've managed is to get
>
> $P\{foo}.bar
> $P{}{foo}.bar
>
> to come through unmodified.
i would try using the canonical "poor man's escaping", which has for
eons proven to be the most reliable, predictable means of escaping in
Velocity:
## do this once at the top or better yet,
## insert it into the context manually (in your java code)
#set( $D = '$' )
${D}P{foo}.bar
>
> I get the impression that velocity escapes tokens rather than individual
> characters, and something in the logic that trys to accommodate tokenizing
> when the {} may or may not be present doesn't handle my situation.
>
> Any help with this is greatly appreciated.
>
> - Mike Wallstedt
>
>
> __________________________________________
> The information contained in this message may be privileged and
> confidential and protected from disclosure. If you are not the intended
> recipient of this message, you are hereby notified that any dissemination,
> distribution, or copying of this communication is strictly prohibited. If
> you have received this communication in error, please notify us immediately
> by replying to the message, and please delete it from your computer.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org