使用“<test>”文本</test>的经典ASP解析XML响应

时间:2014-07-29 13:52:23

标签: xml parsing asp-classic

我有这样的回应:

<?xml version="1.0"?>
<response xmlns="http://xml.test.com">
  <test1>
    <result1/>
  </test1>
</response>

我有这段代码:

For Each node in objXML.selectSingleNode("/response").childNodes
  sResult = sResult & node.xml
Next
Response.Write Server.HTMLEncode(sResult) 

但是这给了我:

<test1 xmlns="http://xml.test.com"> <result1/> </test1>

我如何才能获得以下内容?:

result1

1 个答案:

答案 0 :(得分:0)

试试这个:

For Each node in objXML.selectSingleNode("/response/test1/result1").InnerXml