Re: Assigning dynamic variables

Daniel Dekany <[email protected]> Wed, 16 Jul 2014 00:27:32 +0200
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
And also, update FreeMarker... AFAIR 2.3.20 (from one year ago)
already advices users not to use ${} like that.

-- 
Thanks,
 Daniel Dekany


Tuesday, July 15, 2014, 10:00:08 PM, Wong, Christopher wrote:

> Just do it without the ${} stuff:
>  
> <#assign x = doc.db.persons.personname[0]>
>  
> From: ken4ward [mailto:[email protected]] 
> Sent: Tuesday, July 15, 2014 7:59 AM
> To: [email protected]
> Subject: [FreeMarker-user] Assigning dynamic variables
>  
> I have a sample project I am working on, it is to dynamically get
> inputs from an XML file, when I did the normal assignment static it
> worked, an example: <#assign x = 0> but when i try assigning
> dynamically, as this: <#assign ${x} =
> ${doc.db.persons.personname[0]}> neither did this work this way:
> <#assign x = ${doc.db.persons.personname[0]}> it throws this error:
> Encountered "{" at line 8, column 11 in src/transaction.ftl. Was
> expecting one of: "=" ... "in" ... ">" ... What am I doing wrong? 
> View this message in context: Assigning dynamic variables
> Sent from the freemarker-user mailing list archive at Nabble.com.
>
> This e-mail and files transmitted with it are confidential, and are
> intended solely for the use of the individual or entity to whom this
> e-mail is addressed. If you are not the intended recipient, or the
> employee or agent responsible to deliver it to the intended
> recipient, you are hereby notified that any dissemination,
> distribution or copying of this communication is strictly
> prohibited. If you are not one of the named recipient(s) or
> otherwise have reason to believe that you received this message in
> error, please immediately notify sender by e-mail, and destroy the original message. Thank You.


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds