If I have code such as (which doesn’t work):
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")
and the value from the xml attribute is “The time is ${new Date()}”
how do I get Groovy to evaluate this expression at runtime?
Using the above code I get “The time is ${(new Date()}” instead of an evaluation….
Thanks for any thoughts….