【问题标题】:Classic ASP Parse XML Response with "<test/>" Text带有“<test/>”文本的经典 ASP 解析 XML 响应
【发布时间】:2014-07-29 23:09:51
【问题描述】:

我有这样的回应:

<?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

【问题讨论】:

  • 需要循环遍历吗?如果是这样,您不应该循环For Each node in objXML.selectSingleNode("/response/test1").childNodes吗?然后用sResult = sResult &amp; node.nodeName得到result1节点的名字?

标签: xml parsing asp-classic


【解决方案1】:

试试这个:

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

【讨论】:

  • 不起作用...对象不支持此属性或方法:'selectSingleNode(...).InnerXml'
猜你喜欢
  • 2018-12-09
  • 2012-07-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多