Re: How does one analyse a FreeMarker template??

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

Guo Du wrote:
> FreeMarker is very dynamic, it's not easy to tell the output in
> runtime unless it's been rendered.
>   
I'm not actually trying to figure out the output that a template might 
produce.  I'm looking to get the "model" that describes a given 
FreeMarker template.  The TemplateElement (and its implementations) 
returned from the Template.getRootTreeNode() would be perfect for what I 
want, accept that all the interesting data they have is private and not 
exposed via getters - see the IteratorBlock and DollarVariable classes.
> Alternative, you could do static analysis the  template by track the
> template source used by provider your own template loader:
> freemarker.template.Configuration.setTemplateLoader
Sure... I wanted to avoid writing the template analysis code myself, if 
possible.  That sounds a bit like reinventing the wheel if this is 
something that the FreeMarker runtime API can already do.

Thanks for your help Guo!!!

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
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.