Re: problem calling macro with < />

Daniel Dekany <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Friday, June 8, 2012, 7:19:58 PM, freemarkeruserirving wrote:

> In my freemarker xml file, I have this line:
>
> <header name=&quot;id&quot; value=&quot;&lt;@getId />" />
>
> The macro is:
>
> <#macro getId>
>     20
> </#macro>
>
> But the above macro is never evaluated, so the above code doesn't become:
>
> <header name="id" value="20" />
>
> Any idea?

The problem is that you have &lt;@getId /> instead of <@getId />.
And why do you have &quot;-s instead of "-s? FreeMarker isn't XML;
just type them as you want them in the output.

Also, getId probably should be a #function, not a #macro.

> Thanks.

-- 
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.