ASP調(diào)用遠程XML數(shù)據(jù)的代碼(alexa排名數(shù)據(jù))
更新時間:2011年09月19日 23:46:36 投稿:mdxy-dxy
調(diào)用網(wǎng)易新聞的XML數(shù)據(jù)為例進行講解如果通過ASP遠程調(diào)取XML文件,并讀出數(shù)據(jù)。其實我們之前就使用了asp讀取alexa官方的數(shù)據(jù)。
復(fù)制代碼 代碼如下:
<%
URL="http://news.163.com/special/00011K6L/rss_newstop.xml"
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "GET", url, False
xml.Send
Set xmlDom = server.createObject("microsoft.xmldom")
xmlDom.async=False
xmlDom.ValidateOnParse=false
xmlDom.load(xml.responseXML)
if xmlDom.ReadyState>2 Then
set oItem=xmlDom.getElementsByTagName("item")
%>
<table width="550" border="0" cellpadding="3" cellspacing="1" bgcolor="#ECEFF4">
<%
for i=0 to oItem.length-1
word=oItem(i).childNodes(0).text
title=oItem(i).childNodes.item(0).text
Link=oItem(i).childNodes.item(1).text
pubDate=oItem(i).childNodes.item(3).text
%>
<tr>
<td height="24" bgcolor="#FFFFFF">·<a href="<%=link%>" target="_blank"><font style="font-size:14px;" color="#003366"><%=word%> </font><font color="#999999">(<%=pubdate%>)</font></a></td>
</tr>
<%
next
end if
%>
</table>
遠程文件的內(nèi)容如下:
復(fù)制代碼 代碼如下:
<?xml version="1.0" encoding="GBK"?>
<?xml-stylesheet type="text/css" href="http://news.163.com/css/allrss.css"?>
<rss version="2.0">
<channel>
<title>網(wǎng)易頭條新聞</title>
<link>http://news.163.com/</link>
<description>網(wǎng)易頭條新聞</description>
<pubDate>Wed, 16 Feb 2011 02:59:02 GMT</pubDate>
<lastBuildDate>Wed, 16 Feb 2011 02:59:02 GMT</lastBuildDate>
<item id="1">
<title><![CDATA[一線城市房租連漲]]></title>
<link>http://news.163.com/11/0216/10/6T0NIHOA00014JB6.html</link>
<description><! [CDATA[從去年底開始掀起的租金漲價潮,在春節(jié)后繼續(xù)放大。記者在春節(jié)后接連接到租金上漲的消息,北京、上海、廣州等一線城市房屋的租金持續(xù)上漲,很多中介開年后,重新刷新了年前房屋的出租價格,住房、商鋪、寫字樓的租金都上漲了10%左右不等。記者昨日走訪了廣州的多家中介,中介普遍反映租賃市場火熱,成交單中租單已是賣單五 ]]>......</description>
<pubDate>2011-02-16 10:59:02</pubDate>
</item>
<item id="2">
<title><![CDATA[山東部分面粉廠因農(nóng)民惜售商人囤糧停產(chǎn)]]></title>
<link>http://focus.news.163.com/11/0216/11/6T0R9MIE00011SM9.html</link>
<description><! [CDATA[民以食為天,糧價乃百價之基。 2010年下半年開始的糧價上漲引發(fā)中國經(jīng)濟的連鎖反應(yīng),又因去秋以來的北方大旱加劇糧價上漲預(yù)期,最近國際糧價屢創(chuàng)新高。 穩(wěn)定物價坐上了今年中國經(jīng)濟的“頭把交椅”。春節(jié)期間,專程奔赴糧食主產(chǎn)區(qū)作出最新指示,迅速出臺保護糧食生產(chǎn)的“國十條”。 那么百 ]]>......</description>
<pubDate>2011-02-16 11:30:40</pubDate>
</item>
</channel>
</rss>
相關(guān)文章
asp中使用redim、preserve創(chuàng)建動態(tài)數(shù)組實例
這篇文章主要介紹了asp中使用redim、preserve創(chuàng)建動態(tài)數(shù)組實例,本文還給出了ASP中其它的數(shù)組操作例子,需要的朋友可以參考下2014-08-08asp access數(shù)據(jù)庫并生成XML文件范例
簡單asp加載access數(shù)據(jù)庫,并生成XML,然后再將XML數(shù)據(jù)加載進LIST組件范例學(xué)習(xí)。2009-04-04檢查access數(shù)據(jù)庫中是否存在某個名字的表的asp代碼
首先調(diào)用adodb.connection對象中的openSchema函數(shù),這樣會得到一個Recordset,其中每一條“紀錄”對應(yīng)著數(shù)據(jù)庫中的一張表,“紀錄”的每個“字段”包含了對應(yīng)表的某方面信息。其中TABLE_NAME字段包含了對應(yīng)表的名稱2009-06-06ASP中SELECT下拉菜單同時獲取VALUE和TEXT值的實現(xiàn)代碼
這篇文章主要介紹了ASP中SELECT下拉菜單同時獲取VALUE和TEXT值的實現(xiàn)代碼,需要的朋友可以參考下2020-06-06利用 cache 做對比靜態(tài)頁的網(wǎng)頁技術(shù)
利用 cache 做對比靜態(tài)頁的網(wǎng)頁技術(shù)...2007-10-10