Re: Assigning dynamic variables

"Wong, Christopher" <[email protected]> Tue, 15 Jul 2014 16:00:08 -0400
Newsgroups gmane.comp.web.freemarker.user
Message-ID <5900C695468EF8469DF7867FD277BA1E95AF96E119@PMACPWEXCLS01.corp.epsilon.com>
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<http://freemarker.624813.n4.nabble.com/Assigning-dynamic-variables-tp4655201.html>
Sent from the freemarker-user mailing list archive<http://freemarker.624813.n4.nabble.com/freemarker-user-f624814.html> 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

_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user