XML Syntax with Freemarker?
Michael Cervenak Ahern <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Ok, So this is a question / comment for the floor. A problem that has been bothering me with Freemarker and that is that you can't quite create an Freemarker template that is also a valid XML document. If you are using it as a general text templating solution it is not a problem - so far in our project we are using it for email templates. The problem area that had caused me to initially investigate the project though is in the generation for providing plug points for customer content customization of HTML markup. In this role, I have been looking at ways to reduce / catch developer and customer errors. One easy way to do this is if it supported an XML markup notation. One can *almost *do this with the square bracket notation if you set square brackets as the default... however, I have noticed that there are a couple of times where you still need to put directives at the top of the template which break the XML ness. So to prove my point on catching errors; just take a look at the alternative syntax page itself: http://freemarker.sourceforge.net/docs/dgui_misc_alternativesyntax.html In this example it is missing (and I belatedly starting take notes so I apologize for any omission): - 1 x </th> - 2 x </td> - 2 x </tr> - 1 x </p> - 2 x '/' in close element tag I know this was a hastily written example - and I'd spot the error (I hope) at runtime in the browser; but all of those errors would have been flagged by my syntax checker while editing. Getting rid of the directives at the top and plopping this in an XML editor still leaves one syntax error with the placement of a [/#if]. As such a full blown XML markup does feel in order. Anyhow this is a super long winded question, but is there any thoughts / plans around this? I know Freemarker will never be GXP - however GXP appears dead... long live Freemarker :) One thought around prototyping this once things quite down is to use an XSL template and a custom template cache to look for '.xftl' files that are transformed into standard .ftl files to rather than cracking open the template parser code. While I'm still a ways from finding the time to do this - have there been any thoughts in the past/present around what such a syntax would look like? Thanks in advance, -Mike ------------------------------------------------------------------------------ The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm _______________________________________________ FreeMarker-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freemarker-user