[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

你可能感兴趣的:([Java] Java解析XML格式Response后组装成Map)