You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Brad Cox <bc...@virtualschool.edu> on 2003/12/29 00:41:59 UTC

Re: Variable expansion in macro strings??

Never mind. Replacing $id with ${id} made it go. Sorry for the trouble.

At 6:35 PM -0500 12/28/03, Brad Cox wrote:
>Surely this a cockpit problem but I really can't find it. It appears 
>that variable expansion within strings don't work if there's leading 
>text. For example, note $id appears in several places in this macro 
>#macro(NameQuestion $id $text) <div id="question">	<dl> 
><dt>$id: $text</dt>	 <dd><input name="question.$id.answer" 
>size="32" value="$page.getAnswer($ctx, $id)"></dd>	</dl> </div> 
>#end I'm getting this output. Note that the first $id expands fine 
>but not the one embedded in the name= string. <div id="question"> 
>	<dl>	 <dt>Q0:  A box for names.</dt>	 <dd><input 
>name="question.$id.answer" size="32" value=""></dd>	</dl> </div>
>Deleting the question. prefix and .answer postfix makes the 
>expansion work fine. Suggestions?
>--
>Brad J. Cox, PhD, 703 361 4751, http://virtualschool.edu
>   http://virtualschool.edu/mybank Digital Rights Management System
>          http://virtualschool.edu/jco Java Cryptographic Objects (JCO)
>        http://virtualschool.edu/jwaa Java Web Application Architecture (JWAA)
>      http://virtualschool.edu/java+ Java Preprocessor (Java+)


-- 
Brad J. Cox, PhD, 703 361 4751, http://virtualschool.edu
   http://virtualschool.edu/mybank Digital Rights Management System
          http://virtualschool.edu/jco Java Cryptographic Objects (JCO)
        http://virtualschool.edu/jwaa Java Web Application Architecture (JWAA)
      http://virtualschool.edu/java+ Java Preprocessor (Java+)

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