行業(yè)動態(tài)
ASP讀取返回的XML文件
發(fā)布日期:2009-09-25 閱讀次數(shù):3667 字體大?。?a href="javascript:;" onclick="ChangeFontSize('content',16)">大

<?xml version="1.0" encoding="GB2312" ?>
<result code="1">
<content opname="extendPay">
<message>提交成功 </message>
<validtime>2009-5-12 </validtime>
</content>
</result>

請教ASP本地程序如何遠程讀取上述xml文件信息:
1.code的值
2.message的值
3.validtime的值
 
 
<%
Set xmlServerHttp = CreateObject("Msxml2.ServerXMLHTTP")
xmlServerHttp.open "GET", "http://localhost:90/test.asp", False
xmlServerHttp.send
Set oDoc = xmlServerHttp.responseXML
response.write oDoc.xml
code = oDoc.documentElement.getAttribute("code")
response.write code
message = oDoc.selectSingleNode("//message").text
response.write message
validtime = oDoc.selectSingleNode("//validtime").text
response.write validtime

%>