XML : Access an attribute containing 'hyphen' in freemarker

I have an XML file which is being parsed using Freemarker. One of the attributes in a tag contains '-' and I have to define a condition based on the value of the attribute. For a code snippet as follows:

  <#list fields.* as field>      <#if field.@is-key == "false">          HI      </#if>    

Freemarker throws the following error: FreeMarker template error:

For "-" left-hand operand: Expected a number, but this has evaluated to a sequence+hash (wrapper: f.e.dom.NodeListModel)

The tag being parsed looks as follow:

  <field name="*Name*" type="*Type*" is-key="true" tag="1" />    

Please suggest how to access the attribute with a 'hyphen' in attribute name.

Thanks!

No comments:

Post a Comment