📄 scriptingnews.asp
字号:
<html>
<head>
<title>David Carter-Tod: Scripting News via XML</title>
<meta name="description" content="Using XML within ASP pages">
<meta name="keywords" content="XML, XML-RPC, ASP, Active Server Pages, Internet Explorer, NT, Windows">
<meta name="generator" content="Frontier 6.0 Win95"></head>
<body bgcolor="#FFFFFF" alink="#008000" vlink="#800080" link="#0000FF">
<a href="http://www.chre.vt.edu/dtod/">David Carter-Tod</a> --> <a href="default.asp">XML-RPC</a> --> Scripting News via XML
<HR noshade size=1>
<table border=0 width=100% cellpadding=10 cellspacing=5>
<tr>
<TD width=100 bgcolor="#EEEEEE" valign=top>
<font size="-1">
<h3>XML-RPC</H3>
- <a href="default.asp">XML-RPC</a><P>
- <a href="clientEg/aboutClient.asp">XML-RPC Client</a><P>
- <a href="aboutServer.asp">XML-RPC Server</a><P>
- <a href="download.asp">Download the Code</a><P>
<hr>
- <font color="#800000"><strong><em>Scripting News via XML</em></strong></font><P>
</font>
</td>
<td valign=top>
<h3>Scripting News via XML</h3>
<hr noshade>
This is Scripting News live! Looks weird because the sample code forces an extra-large page width. Downloaded on demand using the Internet Explorer XML verbs on my NT Server in ASP.
<%
Dim url, noOfHeadlines
url = "http://news.userland.com/mostRecentScriptingNews.xml"
Set objXML = Server.CreateObject("Microsoft.XMLDOM")
'Set objXML = Server.CreateObject("Microsoft.XMLHTTP")
Set objLst = Server.CreateObject("Microsoft.XMLDOM")
Set objHdl = Server.CreateObject("Microsoft.XMLDOM")
objXML.async = False
objXML.Load (url)
'objXML.open "GET", url, false
'objXML.send()
If objXML.parseError.errorCode <> 0 Then
'handle the error
End If
Set objLst = objXML.getElementsByTagName("item")
noOfHeadlines = objLst.length
%>
<H1>Scripting News Headlines</H1>
<UL>
<%
For i = 0 To (noOfHeadlines - 1)
Set objHdl = objLst.item(i)
Dim txt
txt=objHdl.childNodes(0).text
Set linkLst = objHdl.getElementsByTagName("link")
if NOT linkLst.length=0 then
for x = 1 to (linkLst.length)
txt = Replace(txt,objHdl.childNodes(x).childNodes(1).text,"<a href=""" & objHdl.childNodes(x).childNodes(0).text & """>" & objHdl.childNodes(x).childNodes(1).text & "</a>",1, -1, 1)
next
end if
Response.Write("<LI>" & txt & "<p>" & vbnewline)
Next
Set objXML = Nothing
Set objLst = Nothing
Set objHdl = Nothing
Set objLst = Nothing
Set objHdl = Nothing
Set linkLst = Nothing
url=""
%>
</UL>
<pre>
<%
Dim url, noOfHeadlines
url = "http://news.userland.com/mostRecentScriptingNews.xml"
Set objXML = Server.CreateObject("Microsoft.XMLDOM")
'Set objXML = Server.CreateObject("Microsoft.XMLHTTP")
Set objLst = Server.CreateObject("Microsoft.XMLDOM")
Set objHdl = Server.CreateObject("Microsoft.XMLDOM")
objXML.async = False
objXML.Load (url)
'objXML.open "GET", url, false
'objXML.send()
If objXML.parseError.errorCode <> 0 Then
'handle the error
End If
Set objLst = objXML.getElementsByTagName("item")
noOfHeadlines = objLst.length
%>
<H1>Scripting News Headlines</H1>
<UL>
<%
For i = 0 To (noOfHeadlines - 1)
Set objHdl = objLst.item(i)
Dim txt
txt=objHdl.childNodes(0).text
Set linkLst = objHdl.getElementsByTagName("link")
if NOT linkLst.length=0 then
for x = 1 to (linkLst.length)
txt = Replace(txt,objHdl.childNodes(x).childNodes(1).text,"<a href=""" & objHdl.childNodes(x).childNodes(0).text & """>" & objHdl.childNodes(x).childNodes(1).text & "</a>",1, -1, 1)
next
end if
Response.Write("<LI>" & txt & "<P>" & vbnewline)
Next
Set objXML = Nothing
Set objLst = Nothing
Set objHdl = Nothing
Set objLst = Nothing
Set objHdl = Nothing
Set linkLst = Nothing
url=""
%>
</pre>
</td>
</tr>
</table>
<HR noshade size=1>
<p align=right>
E-mail: <a href="mailto:dtod@vt.edu">dtod@vt.edu</a>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -