我正在解析Groovy中的XML文件,後來我需要附加返回的變量。如何在Groovy中追加多個字符串?
def lmList = slurperResponse.LastGlobal.HeatMap
String appendedString = lmList.country + lmList.ResponseTime + lmList.timeset
這不適用於追加3個字符串。它只是向右分配第一個字符串。如何在Groovy中正確實現它?我試圖concat
丟給以下錯誤:
groovy.lang.MissingMethodException: No signature of method: groovy.util.slurpersupport.NodeChildren.concat() is applicable for argument types: (groovy.util.slurpersupport.NodeChildren) values: [4468]
Possible solutions: toFloat(), collect(), collect(groovy.lang.Closure)
at
你能給一些示例XML? –