注册 登录
编程论坛 ASP技术论坛

asp读取xml

zft825 发布于 2010-12-23 14:54, 378 次点击
程序代码:
<?xml version="1.0" encoding="gb2312"?>
<songkurInfo serviceURL="xxxxx" partnerID="xxx" pass="xx" Ratio="xxx" tel="33445890" netName="xxx" netAddress="">
   
</songkurInfo>


我的asp代码!,没有效果

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--读取xml配置文件-->
程序代码:
<%
Set oDoc=Server.CreateObject("Microsoft.XMLDOM")

With oDoc
    .async
=False
    .load Server.MapPath(
"songkurInfo.xml")
   
Set oNode=.selectSingleNode("//songkurInfo")
End  With

Response.Write oNode.getAttribute(
"serviceURL")

Set oDoc=nothing
Set oNode=nothing
%>

5 回复
#2
zft8252010-12-23 14:57
运行的时候出现:该网页无法显示
#3
gupiao1752010-12-23 22:04
<?xml version="1.0" encoding="gb2312"?>改为:<?xml version="1.0" encoding="utf-8"?>,try it again!
#4
zft8252010-12-24 10:28
没有反应!
#5
dzt00012010-12-24 12:47
我测试你的代码,没有问题。
#6
leilpzone2011-03-18 09:48
长见识喽
1