[thelist] Does anyone have a complete, working ASP code snippet that will grab an external RSS/RDF file and parse it into HTML?

Anthony Baratta Anthony at Baratta.com
Fri Mar 16 15:04:02 CST 2001


At 11:13 AM 3/16/2001, you wrote:
>I realise that RDF/RSS files are simply xml files, but i cannot figure out
>how to grab an external file (ie http://www.slashdot.org/slashdot.rdf ) from
>another server.  a code snippet or link to a good solid tutorial would be
>greatly appreciated.  please and thanks

There are two ways to do this:

Option One

<%
'' XML location String....
    varXMLPage = "http://www.blahblahblah.org/rds/file.xml"

'' Getting XML File from Server
     Set xObj = Server.CreateObject("SOFTWING.AspTear")
     strRetVal = xObj.Retrieve(varXMLPage,2,"","","")

'' This way you can manipulate the file before stuffing it
'' into the XML Object.
'' Also good if the XML file does not conform to MS XML
'' standards.
     varXMLPage_New = DataManagelment(strRetVal)

'' Stuffing Data into an XML Object
     Set XMLPage = CreateObject("Microsoft.XMLDOM")
     XMLPage.async = false
     returnValue_Page = XMLPage.loadXML(varXMLPage_New)
%>


Option Two

Suck directly into the XML object.....

<%
'' XML location String....
    varXMLPage = "http://www.blahblahblah.org/rds/file.xml"

'' Stuffing Data into an XML Object
     Set XMLPage = CreateObject("Microsoft.XMLDOM")
     XMLPage.async = false
     returnValue_Page = XMLPage.loadXML(varXMLPage)
%>

Piece of pie. ;-)

---
Anthony Baratta
President
Keyboard Jockeys





More information about the thelist mailing list