ASP 解析XML
4 then
exit function
end if
getHTTPPage=Http.responseText
set http=nothing
if err.number0 then err.Clear
end function
Code
<%
Public function getHTTPPage(url)
dim Http
set Http=server.createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=Http.responseText
set http=nothing
if err.number<>0 then err.Clear
end function
strXML=getHTTPPage("http://www.vcpit.com/getdata/pl.php?action=pack&game=100&site=www.wowgold800.com")
Set objXML = Server.CreateObject("MSXML2.DOMDocument")
objXML.validateonparse = true
objXML.async=false
objXML.loadXML(strXML)
Set objNodes = objXML.getElementsByTagName("Packs/Pack")
if not isNUll(objNodes(0)) then
For i= 0 to cint(objNodes.length)-1
%>
<li>
<form action='powerlevel_orderinfo.asp' id='pack<%=i%>' method='post'>
<input type='hidden' name='itemname' value='<%=Trim(objNodes(i).getAttribute("Name"))%>'/>
<input type='hidden' name='needprice' value='<%=Trim(objNodes(i).selectSingleNode("Price").Text)%>'/>
<input type='hidden' name='needtime' value='<%=Trim(objNodes(i).selectSingleNode("Time").Text)%>'/>
<input type='hidden' name='Desc' value='<%=Trim(objNodes(i).selectSingleNode("Desc").Text)%>'/>
<input type='hidden' name='guid' value='<%=Trim(objNodes(i).selectSingleNode("guid").Text)%>'/>
<input type='hidden' name='status' value='<%=Trim(objNodes(i).selectSingleNode("status").Text)%>'/>
<span class="list2a"><a href="javascript:$('pack<%=i%>').submit();"><%=Trim(objNodes(i).getAttribute("Name"))%></a></span> <span class="list2b">$ <%=Trim(objNodes(i).selectSingleNode("Price").Text)%></span> <span class="list2c"><%=Trim(objNodes(i).selectSingleNode("Time").Text)%> day</span> <span class="list2d"><a href="javascript:$('pack<%=i%>').submit();" class="buy">Buy Now</a></span>
</form>
</li>
<%
next
end if
%>
<%
Public function getHTTPPage(url)
dim Http
set Http=server.createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=Http.responseText
set http=nothing
if err.number<>0 then err.Clear
end function
strXML=getHTTPPage("http://www.vcpit.com/getdata/pl.php?action=pack&game=100&site=www.wowgold800.com")
Set objXML = Server.CreateObject("MSXML2.DOMDocument")
objXML.validateonparse = true
objXML.async=false
objXML.loadXML(strXML)
Set objNodes = objXML.getElementsByTagName("Packs/Pack")
if not isNUll(objNodes(0)) then
For i= 0 to cint(objNodes.length)-1
%>
<li>
<form action='powerlevel_orderinfo.asp' id='pack<%=i%>' method='post'>
<input type='hidden' name='itemname' value='<%=Trim(objNodes(i).getAttribute("Name"))%>'/>
<input type='hidden' name='needprice' value='<%=Trim(objNodes(i).selectSingleNode("Price").Text)%>'/>
<input type='hidden' name='needtime' value='<%=Trim(objNodes(i).selectSingleNode("Time").Text)%>'/>
<input type='hidden' name='Desc' value='<%=Trim(objNodes(i).selectSingleNode("Desc").Text)%>'/>
<input type='hidden' name='guid' value='<%=Trim(objNodes(i).selectSingleNode("guid").Text)%>'/>
<input type='hidden' name='status' value='<%=Trim(objNodes(i).selectSingleNode("status").Text)%>'/>
<span class="list2a"><a href="javascript:$('pack<%=i%>').submit();"><%=Trim(objNodes(i).getAttribute("Name"))%></a></span> <span class="list2b">$ <%=Trim(objNodes(i).selectSingleNode("Price").Text)%></span> <span class="list2c"><%=Trim(objNodes(i).selectSingleNode("Time").Text)%> day</span> <span class="list2d"><a href="javascript:$('pack<%=i%>').submit();" class="buy">Buy Now</a></span>
</form>
</li>
<%
next
end if
%>
http://demopro.myzhongsou.cn/hz/gj/hsj/index.asp