asp读取远程xml麻烦高手来帮下忙我菜鸟我的分数都给您!
地址为(http://www.0008.com/spxml.aspx )访问显示代码为
<?xml version="1.0" encoding="utf-8" ?>
- <sp>
<count size="2123067" />
- <data>
<record sp="牙刷" splx="日用商品" spjg="200元" xingming="张三" />
<record sp="毛巾" splx="日用商品" spjg="200元" xingming="张三" />
</data>
</sp>
现在要asp远程读取以上内容 麻烦高手说下·十分感谢!
--------------------编程问答-------------------- 要读取以参数 sp splx 谢谢啦! --------------------编程问答--------------------
--------------------编程问答-------------------- http://www.0008.com/spxml.aspx 为获取xml信息的地址
//读取xml文件
string str = File.ReadAllText("D:\\1.txt", Encoding.Default);
var ary = Regex.Matches(str, @"(?<=<record\s*).*?sp=""(?<sp>\w+)"".*?splx=""(?<splx>\w+)"".*?spjg=""(?<spjg>\w+)"".*?xingming=""(?<xingming>\w+)""")
.Cast<Match>().Select(t => new
{
sp=t.Groups["sp"].Value,
splx=t.Groups["splx"].Value,
spjg=t.Groups["spjg"].Value,
xingming=t.Groups["xingming"].Value
}).ToArray();
Microsoft VBScript compilation 错误 '800a0401'
Expected end of statement
第二行出错了· --------------------编程问答--------------------
<%
Set http=Server.CreateObject("MSXML2.ServerXMLHTTP")
http.Open "GET","http://www.0008.com/spxml.aspx",False
http.send
dim xml,objNode,objAtr,nCntChd,nCntAtr
Set xml=Server.CreateObject("Microsoft.XMLDOM")
'Set xml=server.CreateObject("MSXML.DOMDocument")
xml.Async=False
xml.Load(http.ResponseXML)
Set objNode=xml.documentElement
nCntChd=objNode.ChildNodes.length-1
for i=0 to nCntChd
set objAtr=objNode.ChildNodes.item(i)
response.Write objNode.childNodes.item(i).text &" "
nCntAtr=objAtr.Attributes.length-1
for j=0 to nCntAtr
response.write objAtr.Attributes.item(j).Text&" "
next
response.write ""
next
Set objAtr=Nothing
Set objNode=Nothing
Set xml=Nothing
%>
这段代码显示页面只显示2123067 其他的都不显示。。。高手路过请看下 谢谢·
补充:.NET技术 , ASP.NET