Hi Mike,

First, a quick side comment. Velocity.evaluate() does work fine. But if you are calling Velocity repeatedly, consider using a resource loader like FileResourceLoader or ClasspathResourceLoader. The caching mechanism in the resource loader speeds up things tremendously.

Velocity is more aimed at generating the text rather than parsing it. It doesn't contain much in the way of identifying content. It's possible you might load the file in a resource loader, take the returned Template object, and break it down into to the constituent parsed nodes. But since this is essentially an internal structure, the specific node types it might change in future versions.

WILL

Smith, Mike H wrote:
Hi,
I'm a Velocity newbie, and am evaluating to see if it can address our
relatively simple requirements.

I need to use String based templates. After a bit if digging around I
found the following function:

Velocity.evaluate( context, writer, "", templateString );

This works pretty well for our purposes.

However I also need to get a list of candidate keys from the template
String.

So if my template contains: "$a $b" I need to extract ["a","b"].

Thanks.

Mike



--
Forio Business Simulations

Will Glass-Husain
phone (415) 440-7500 x89
mobile (415) 235-4293
[EMAIL PROTECTED]
www.forio.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to