I plan to use Blog RSS Reader for personal use when I am idle. Today I will start collecting data.
Dim objHTTP, objXML, objXSL
Set objXSL = Server. CreateObject ("Microsoft. XMLDOM ")
ObjXSL. async = False
ObjXSL. load (Server. MapPath ("rss. xsl "))
Set objHTTP = Server. CreateObject ("Microsoft. XMLHTTP ")
ObjHTTP. open "GET", objURL, false
ObjHTTP. send
Set objXML = objHTTP. responseXML
ObjHTML = objXML. transformNode (objXSL)
ObjHTML = replace (objHTML ,"""","'")
Set objHTTP = Nothing
'Objhtml = Server. HTMLEncode (objHTML)
%>
Var rsscode;
Rsscode = "<% = objHTML %> ";
RSSbox. innerHTML = "";
If (rsscode = "")
{
RSSbox. innerHTML = "nothing found ";
}
RSSbox. innerHTML = rsscode
<? Xml version = "1.0" encoding = "GB2312"?>
<Xsl: stylesheet xmlns: xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0">
<Xsl: template match = "/">
<Ul>
<Xsl: apply-templates select = "// item"/>
</Ul>
</Xsl: template>
<Xsl: template match = "item">
<Li>
<Xsl: element name = "a">
<Xsl: attribute name = "href"> <xsl: value-of select = "link"/> </xsl: attribute>
<Xsl: attribute name = "title"> <xsl: value-of select = "PubDate"/> </xsl: attribute>
<Xsl: value-of select = "title"/>
</Xsl: element>
</Li>
</Xsl: template>
</Xsl: stylesheet>
New work of Chapter E of Mencius
MS XmlDom asynchronously loads Xml files
<Script>
Var xmldoc;
Function Load (){
Xmldoc = new ActiveXObject ("Msxml2.DOMDocument ");
Xmldoc. onreadystatechange = CheckState;
Xmldoc. resolveExternals = false;
Xmldoc. load (URL. value );
}
Function CheckState (){
Var state = xmldoc. readyState;
RESULTS. innerHTML + = "loading status =" + state + "<BR>"
If (state = 4 ){
Var err = xmldoc. parseError;
If (err. errorCode! = 0)
RESULTS. innerHTML + = err. reason + "<BR>"
Else
{
RESULTS. innerHTML + = "loaded successfully. "+" <BR>"
Alert (xmldoc. xml)
}
}
}
</Script>
URL: <input type = text size = 60 id = URL value = "http://dotnet.aspx.cc/Rss.aspx">
<Input type = button value = "XML" onclick = "Load ()">
<Div id = RESULTS style = "color: red; font-weight: bold;"> </div> </script>
Consuming RSS feeds on your web site
Http://www.dotnetbips.com/displayarticle.aspx? Id = 243
|
A Free Personal Web-based RSS News Reader Http://reader.rocketinfo.com/desktop/ |