[stringtemplate-interest] Problem with ST 4.0.3
Terence Parr
parrt at cs.usfca.edu
Wed Jun 22 15:16:32 PDT 2011
crap. it should be defining /html/_sub1 not /_sub1 no doubt. ;) Where were you last week! :D
let me try here.
T
On Jun 22, 2011, at 2:49 PM, Christophe Roudet wrote:
> Hello,
>
> I have just upgraded to ST v4.0.3 and I have a template that was
> working with 4.0.2 that no longer works
> So have a template file:
> ae.st:
> ae(triggerUserList) ::= <<
> <triggerUserList:{u | <u>}>
>>>
>
> some test code:
>
> STGroup group = new STGroupDir("conf/emailTemplates");
> ST st = group.getInstanceOf("/html/ae");
> List<User> users = new ArrayList<User>();
> User u = new User();
> u.setUsername("u1");
> u.setEmail("u1 at email.com");
> users.add(u);
> u = new User();
> u.setUsername("u2");
> u.setEmail("u2 at email.com");
> users.add(u);
> st.add("triggerUserList", users);
> System.out.println(st.render());
>
> I have some trace on the console:
> context [/html/ae] 1:7 no such template: /html/_sub1
> context [/html/ae] 1:23 passed 1 arg(s) to template null with 0 declared arg(s)
> context [/html/ae] 1:7 passed 1 arg(s) to template null with 0 declared arg(s)
> context [/html/ae] 1:7 passed 1 arg(s) to template null with 0 declared arg(s)
>
> A similar template build like this works fine:
> STGroup g = new STGroup('$', '$');
> g.defineTemplate("test", "triggerUserList", "$triggerUserList:{u |
> $u.username$ ($u.email$)}; separator=\", \"$");
> ST st = g.getInstanceOf("test");
>
> Any idea,?
>
> thanks,
>
> Christophe
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
More information about the stringtemplate-interest
mailing list