这没有意义,但这种时髦的行为很荒谬。
代码是这样的:
def xmlArray = xmlMap['ClientXml'] //Map has key and array of xml for each key.
println "Length of Array"
println xmlArray.length //prints [, ,]
println xmlArray.size() //prints 3
println groovy.xml.XmlUtil.serialize(xmlArray[1] ) //prints xml
println xmlArray.getClass().name //prints java.util.ArrayList
//This part does not work
xmlArray.each {
println it
}
不知道我的代码发生了什么变化,但它以前工作得很好。