[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)

}

}

posted @ 2016-06-15 11:29  Sunshine168  阅读(776)  评论(0编辑  收藏  举报