You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by anita kulshreshtha <a_...@yahoo.com> on 2004/05/24 16:08:20 UTC

user-guide

Hi 
   The following example in user-guide's section on
Advanced Issues: escaping !
is correct if $foo is undefined. Whereas in the
example before it $foo is
defined. Did I understand it coerrectly? Any help is
appreciated. 
                                Thanks 
                                                      
  Anita
 
 Contrast this with regular escaping, where \ precedes
$:
		
	

\$foo
\$!foo
\$!{foo}
\\$!{foo}

	
		

This renders as:
		
	

\$foo
\$!foo
\$!{foo}
\bar


	
		
__________________________________
Do you Yahoo!?
Yahoo! Domains � Claim yours for only $14.70/year
http://smallbusiness.promotions.yahoo.com/offer 

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


Re: user-guide

Posted by Christoph Reck <ap...@recks.org>.
Hi,

disregarding what is in the user's guide, I recommend
using the escaping workaround

#set( $Q = '"' )
#set( $B = '\' )
${Q}foo
${Q}!foo
${B}${Q}!foo
${B}${B}${Q}!foo

to obtain anything you literally want. (The implementation
using the escaping character does not always do what you
would expect - a bug!).

P.S. I also use $TAB and $NL many times to enhance my output.
The values are obtained via a context tool having a
decodeUrl("%09") and "%0a" method.

Cheers,
Christoph

anita kulshreshtha wrote:
> Hi 
>    The following example in user-guide's section on
> Advanced Issues: escaping !
> is correct if $foo is undefined. Whereas in the
> example before it $foo is
> defined. Did I understand it coerrectly? Any help is
> appreciated. 
>                                 Thanks 
>                                                       
>   Anita
>  
>  Contrast this with regular escaping, where \ precedes
> $:
> 		
> 	
> 
> \$foo
> \$!foo
> \$!{foo}
> \\$!{foo}
> 
> 	
> 		
> 
> This renders as:
> 		
> 	
> 
> \$foo
> \$!foo
> \$!{foo}
> \bar
> 
> 
> 	
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Domains – Claim yours for only $14.70/year
> http://smallbusiness.promotions.yahoo.com/offer 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
> 
> 
> 

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