velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste BRIAUD -- Novlog <j-b.bri...@novlog.com>
Subject How to list Velocity template variables ?
Date Mon, 20 Dec 2010 17:33:22 GMT
Hi,

Before processing a template, I need to have a list of all variables needed by the template.
I had to proceed to complex validation.

I thought to process the template without context and handle the event to get all missing
variables.
Unfortunately, this would not take the variable in #ELSE clause for example in case of #IF.

VTL is interpreted but is there a way to handle all variable in a template ?

The other approach I was thinking about is to build a grammar using SableCC for example.
Then, I would be able to parse a template and check all variables.
The bonus would be to ensure the template VTL syntax is OK.

The reason why I need that : the end user can upload a template.

Any ideas, advices ?

Thanks !

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message