TIGblogs TIG | TIGblogs GROUP TIGBLOGS LOGIN SIGNUP
luke.at.large
luke.at.large
« previous 5


Parsing OPML files with ASP (classic ASP)

A technical one here...

I struggled for hours trying to figure out how to parse OPML files (the popular way for storing lists of RSS feeds in one place) using Active Server Pages (ASP), classic not .NET. I finally found a mixture between a solution to something similar to OPML and a bit of adaptation on my part.

If you need it, I hope this helps:



dim xmlDom, oNode, nodeCol
set xmlDom = Server.CreateObject("MSXML2.DOMDocument.4.0")
xmlDom.load(FILENAME) ' Point this to the relevant OPML file

if(xmlDom.parseError <> 0) then
Response.Write("Invalid XML loaded. " & xmlDom.parseError.reason)
Response.End
end if

if xmlDom.documentElement is nothing then
Response.Write("Invalid XML loaded. No root tag exists")
Response.End
end if

set oNode = xmlDom.documentElement.selectSingleNode("opml")
if not oNode is nothing then
Response.Write("Description: " & oNode.text & "
")
end if

set nodeCol = xmlDom.documentElement.selectNodes("body/outline")
for each oNode in nodeCol
FeedTitle = oNode.getAttribute("title")
FeedURL = oNode.getAttribute("xmlUrl")

' DO WHAT YOU WANT WITH THESE VARIABLES HERE

next

Set nodeCol = Nothing
Set xmlDom = Nothing


May 30, 2006 | 4:34 AM Comments  0 comments

Tags:


« previous 5


Luke Cholerton-Bozier's Profile


Latest Posts
What happens online,...
Energy zap
Honeymoon over for Obama
Back to TigBlogs
Carbon offset Range...

Monthly Archive
January 2003
February 2003
March 2003
August 2003
September 2003
October 2003
November 2003
December 2003
January 2004
February 2004
March 2004
April 2004
May 2004
June 2004
July 2004
August 2004
September 2004
October 2004
November 2004
December 2004
January 2005
February 2005
March 2005
April 2005
May 2005
July 2005
August 2005
September 2005
October 2005
November 2005
December 2005
January 2006
March 2006
April 2006
May 2006
June 2006
July 2006
August 2006
September 2006
November 2006
December 2006
January 2007
March 2007
September 2007
June 2008
July 2008

Change Language


Tags Archive
dailyshow death internet johnmccain jonstewart obama politics tired uselection web2.0


127780 views
Important Disclaimer