On Jan 31, 2008 4:57 PM, Michael Wallstedt <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]