Problems with parsing a XML file
bribon <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I'm working with Alfresco, so I'm trying to work with Freemarker. My problem
is when I try to parse a XML file, I've always got this error:
"06080009 Wrapped Exception (with status template): 06080008 Error during
processing of the template 'Error on line 4, column 10 in
org/alfresco/alert/alert.get.html.ftl Expecting a string, date or number
here, Expression dom.book.@title is instead a
freemarker.ext.dom.NodeListModel'. Please contact your system
administrator."
I'm sure that XML file is used by dom variable. I've also tried with the
example which you can find in a Freemarker tutorial. This is the Freemarker
example:
XML file:
<?xml version="1.0" standalone="yes"?>
<book title="Book Title">
<chapter>
<title>Chapter 1</title>
<para>p1.1</para>
<para>p1.2</para>
<para>p1.3</para>
</chapter>
<chapter>
<title>Chapter 2</title>
<para>p2.1</para>
<para>p2.2</para>
</chapter>
</book>
Freemarker file:
<#if document.mimetype = "text/xml">
<#assign dom=document.xmlNodeModel>
<h1>${dom.book.@title}</h1>
<#list dom.book.chapter as c>
<h2>${c.title}</2>
</#list>
</#if>
It's very important to solve this problem. Can anyone help me out?
Thanks in advance
--
View this message in context: http://www.nabble.com/Problems-with-parsing-a-XML-file-tp24397444p24397444.html
Sent from the freemarker-user mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge