logo       

Re: Evaluating dynamic GPath: msg#00070

lang.groovy.user

Subject: Re: Evaluating dynamic GPath

Please don't hit "Reply" unless you are replying to a message... You message shows up as a reply to mine, but it clearly isn't. This messes up thread grouping in mail clients that support it.

TIA,
Daniel Serodio

Dion Almaer wrote:

Hi guys -

Is there a nice clean way in which you can take a GPath expression as a
String and kinda evaluate it?

foo = new XmlParser().parse("foo.xml")
headings = foo.bar.heading

Is fine, but what about if you wanted to:

foo = new XmlParser().parse("foo.xml")
Headings = evaluateGPath(args[0]) # Where args[0] is "foo.bar.heading"

Anything nifty that can be done?

Cheers,

Dion





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise