Handling missing node values with NodeModel

Tom Fennelly <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Hi.

I'm using a NodeModel and was wondering how missing nodes can be 
handled?  I'm looking for the equivalent of the unsafe_expr!default_expr 
notation 
(http://freemarker.sourceforge.net/docs/dgui_template_exp.html#dgui_template_exp_missing), 
but something that works for NodeModels (the default did not work for me).

BTW.. the template's in question use the .vars syntax in the 
expressions.  So, when I do the following I get an exception - 
${.vars["com.acme.Travel"]["checkIn"]!""}.  The exception is...

         Expecting a string, date or number here, Expression .vars["com.acme.Travel"]["checkIn"]!"" is instead a freemarker.ext.dom.NodeListModel
         The problematic instruction:
         ----------
         ==>  ${.vars["com.acme.Travel"]["checkIn"]!""} [on line 3, column 19 in free-marker-template]
         ----------

         Java backtrace for programmers:
         ----------
         freemarker.core.NonStringException: Error on line 3, column 21 in free-marker-template


Thanks in advance.

T.

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev

_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user
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.