Parsing expression only

32 views
Skip to first unread message

Harum Budi

unread,
Oct 12, 2012, 4:29:48 AM10/12/12
to xsl...@googlegroups.com
Is there a way to do something like this:

my $expr = q($x ~ " love " ~ $y);
say $tx->render_expr($expr, { x=> "I", y => "Xslate" });

Of course I can do something like this:

say $tx->render_string("<: $expr :>", { x=> "I", y => "Xslate" });

but then I have to parse and escape $expr. I'd prefer that user supplying $expr cannot break out of the tag (e.g. ":> blah <:") although it's not really a security issue, I think.

gfx

unread,
Dec 14, 2012, 4:46:32 AM12/14/12
to xsl...@googlegroups.com
Sorry to be late.

Unfortunately, you cannot. Xslate is a template engine, not an expression executor.
Reply all
Reply to author
Forward
0 new messages