macro errors

Sam Steingold <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Organization disorganization
Message-ID <[email protected]>
Hi,
I am getting various macro errors:

<#macro sentiment scmr model><#if scmr??>
  <#assign senti = "${scmr.results[model]}">
    <#if senti??>
      <td>${senti} ---- ${senti.sentimentType}</td>
      <td>${senti.score?html}</td>
    <#else><td align="center" colspan="2">none</td>
    </#if>
</#if></#macro>

first error:

POSITIVE(1.0/1) ---- Expected hash. senti evaluated instead to freemarker.template.SimpleScalar 

this is coming from "${senti} ---- ${senti.sentimentType}"
apparently, "senti" is the string representation of the object,
not the object itself.
how do I fix that?

second error:

Error executing macro: sentiment required parameter: scmr is not specified.

this is coming from this invocation:

 <@sentiment model=model scmr=result.title/>

here `result' is non-null, but result.title is null.
I do check for that in the macro, but, apparently, it has to be done
outside.  Why?

Thanks!


-- 
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.childpsy.net/ http://dhimmi.com http://thereligionofpeace.com
http://pmw.org.il http://think-israel.org http://jihadwatch.org
Don't take life too seriously, you'll never get out of it alive!


------------------------------------------------------------------------------
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.