[Java] Java解析XML格式Response后组装成Map

//Get and Parse Response

def response = context.expand(‘${TestStepName#Response}’)

def xmlParser = new XmlParser().parseText(response)

HashMap map = new HashMap()

xmlParser.r.each{

String name = it.attribute("name")

it.c.each{

String value = it.attribute("v")

map.put(name,value)

}

}

原文地址:https://www.cnblogs.com/wynlfd/p/5586852.html