Share

FreeMarker

Subscribe

freemarker.core.ParseException:

  1. 2009-11-04 02:15:54 UTC

    Hi Guys, I'm new to freemarker and I am running into problems.

    I have a template as shown below but I am getting the error: freemarker.core.ParseException: Encountered "</#foreach>" at line 32, column 1 in test.ftl. Was expecting one of: ....

    I can't see anything wrong with the template. Any ideas?

    Thanks Richard

    TEMPLATE HERE: <#ftl nsprefixes={ "aus":"urn:Aon:General:BusinessPack", "ac":"urn:ACORD:PCS:xml:specification:schema:DRAFT2.0.0Phase3.1" } /> <HTML> <HEAD> <TITLE> New Document </TITLE> </HEAD>

    <BODY>

    <!-- SECTION: CONTACTS This part describes the contact details --> <b>Contact Details</b> <BR/> <#list doc["aus:PolicyMessage/ac:Person[@ac:Id=/aus:PolicyMessage/aus:Organization[@ac:Id='Insured1']/ac:Contact/@ac:PartyReference]"] as ref >

    <#foreach phonenum in ref["ac:BusinessPhoneNumber"] > <#if phonenum["normalize-space(ac:PhoneTypeCode)"] = "ac:Phone"> <tr> <td>Phone:</td> <td>${phonenum["ac:PhoneNumber"]}</td> </tr> <#else> <tr> <td>${phonenum["normalize-space(ac:PhoneTypeCode)"]}</td> <td>${phonenum["ac:PhoneNumber"]}</td> </tr> <#/if> </#foreach>

    </#list> </BODY> </HTML>

  2. nobody

    2009-11-04 08:46:56 UTC

    Because you have a typo: <#/if> instead of </#if>. (If <#/if> is just text for FreeMarker, so you try to close #foreach when you are still inside the #else block, hence the </#foreach> "wasn't expected"... But the error message is admitedly not very helpful.)

< Previous | 1 | Next >

Add a Reply

You can use Markdown syntax in your reply.

Preview

Monitor this

Log in to monitor this topic. Not registered? Create an account to receive email updates when replies are posted to this topic. If you do not log in or register, your reply will be added anonymously.