You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Aaron Zeckoski <aa...@vt.edu> on 2007/05/09 11:20:55 UTC

Escaping invalid references?

I am having trouble with velocity not escaping some references in a
maven.xml file which I am processing with velocity.

Here is the offending bit (there are others like it):
<j:if test="${dep.getProperty('explode') == 'true'}">

I tried escaping it like this:
<j:if test="\${dep.getProperty('explode') == 'true'}">

But I get this error message either way:
org.apache.velocity.exception.ParseErrorException: Encountered " ==
\'true\'}\">\r\n        <j:if test=\"" at line 12, column 48.
Was expecting one of:
    "}" ...
    <DOT> ...
    ERROR: Could not process velocity template: maven.xml

Ideally I want velocity to just ignore this entire line and output it
as is. Is there a way I can get that result?

Thanks
-AZ


-- 
Aaron Zeckoski (aaronz@vt.edu)
Senior Research Engineer - CARET - Cambridge University
[http://bugs.sakaiproject.org/confluence/display/~aaronz/]
Sakai Fellow - [http://aaronz-sakai.blogspot.com/]

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


Re: Escaping invalid references?

Posted by Nathan Bubna <nb...@gmail.com>.
#set( $d = '$' )

<j:if test="${d}{dep.getProperty('explode') == 'true'}">

On 5/9/07, Aaron Zeckoski <aa...@vt.edu> wrote:
> I am having trouble with velocity not escaping some references in a
> maven.xml file which I am processing with velocity.
>
> Here is the offending bit (there are others like it):
> <j:if test="${dep.getProperty('explode') == 'true'}">
>
> I tried escaping it like this:
> <j:if test="\${dep.getProperty('explode') == 'true'}">
>
> But I get this error message either way:
> org.apache.velocity.exception.ParseErrorException: Encountered " ==
> \'true\'}\">\r\n        <j:if test=\"" at line 12, column 48.
> Was expecting one of:
>     "}" ...
>     <DOT> ...
>     ERROR: Could not process velocity template: maven.xml
>
> Ideally I want velocity to just ignore this entire line and output it
> as is. Is there a way I can get that result?
>
> Thanks
> -AZ
>
>
> --
> Aaron Zeckoski (aaronz@vt.edu)
> Senior Research Engineer - CARET - Cambridge University
> [http://bugs.sakaiproject.org/confluence/display/~aaronz/]
> Sakai Fellow - [http://aaronz-sakai.blogspot.com/]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

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