velocity-user mailing list archives

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

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
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:
For additional commands, e-mail:

View raw message