[stringtemplate-interest] Problem with .stg files

Bob citibob at comcast.net
Sat May 3 11:49:09 PDT 2008


I am new to StringTemplate, so maybe this is addressed.  But I could not
find any solution...

I set up a String Template Group (see below).

Then I tried to access it as follows:

	// Get the StringTemplate...
	InputStream in =
	StringTemplateGroup stg = new StringTemplateGroup(new
	StringTemplate st = stg.getInstanceOf("summary");

But when I tried to use the resulting string template, the parser chokes
on the first "/" character in summary.  What am I doing wrong?  Does
this kind of summar group just not work for HTML templates?

I ultimately switched to putting one template per file (.st files
instead of .stg files), and it now works.

-- Bob


group summaryGroup;

summary(person,phones) ::= <<
<li>Name: $person.firstname$ $person.lastname$</li>
<li>Email: $person.email$</li>

<table border=1>

More information about the stringtemplate-interest mailing list