How Can I Use Config Entries with Dots When Parsing with XmlSlurper
问题 I'm trying to use a groovy Config entry to parse an xml file with XmlSlurper. Here's the Config file: sample { xml { frompath = "Email.From" } } Here's the XML <xml> <Email> <From> <Address>foo@bar.com</Address> <Alias>Foo Bar</Alias> </From> <Email> </xml> This is what I tried initially: XmlSlurper slurper = new XmlSlurper() def record = slurper.parseText((new File("myfile.xml")).text) def emailFrom = record?."${grailsApplication.config.sample.xml.frompath}".Address.text() This doesn't work