Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » How to escape ${expr} in JET templates?
How to escape ${expr} in JET templates? [message #492568] Tue, 20 October 2009 15:09 Go to next message
Asha Ramegowda is currently offline Asha Ramegowda
Messages: 77
Registered: July 2009
Member
Hi,

We need to have some placeholders in the form of ${place holder} in our template files. But JET recognizes the ${some name} as a variable. Is there any way to escape this string or the $ symbol in JET?

Thank you,

Asha.
Re: How to escape ${expr} in JET templates? [message #492578 is a reply to message #492568] Tue, 20 October 2009 15:46 Go to previous message
Paul Elder is currently offline Paul Elder
Messages: 849
Registered: July 2009
Senior Member
Asha:

${ '${place holder}' }


That is, put the ${ ... } text into quotes within another ${ ... }.

You can use double or single quotes.

If you need to escape a quote, double it up:

Example: To embed ${"hello world"} in the template output, do

${ "${""hello world""}" }

Or, you could break it up like this:

${ "${" }"hello world"}


I confess that not of these look particularly readable.

Quoting strategy shamelessly stolen from JSP/EL

Paul
Previous Topic:Xtend: How to collect all visible instances of xpand::Type?
Next Topic:[JET] Jet editor still now working in Galileo
Goto Forum:
  


Current Time: Thu Aug 28 19:19:36 EDT 2014

Powered by FUDForum. Page generated in 0.02426 seconds