title: evaluating a groovy string expression at runtime
body: <p>If I have code such as (which doesn’t work):</p>
  
  <pre><code>def value = element.getAttribute("value")
  Binding binding = new Binding();
  binding.setVariable("valueExpression", value);
  def interpolatedValue = new GroovyShell(binding).evaluate("return valueExpression")
  println ("interpolated Value = $interpolatedValue")
  </code></pre>
  
  <p>and the value from the xml attribute is “The time is ${new Date()}”</p>
  
  <p>how do I get Groovy to evaluate this expression at runtime?</p>
  
  <p>Using the above code I get “The time is ${(new Date()}” instead of an evaluation….</p>
  
  <p>Thanks for any thoughts….</p>