得到Xml中 元素的值

it2026-09-25  17

<?xml version="1.0" encoding="utf-8" ?><Response service="RouteService"> <Head>OK</Head> <Body> <RouteResponse mailno="249269444755"> <Route  @body="30" /> </RouteResponse> </Body></Response>

 

我要是想获取到@body的值

xmlElement=<Route  @body="30" /> 就  element.getAttribute("@Body")

 

转载于:https://www.cnblogs.com/ZkbFighting/p/9858237.html

最新回复(0)