Still working on my RSS Reader application for Lotus Notes.
Need to read a rss feed from Lotus Script. Unfortunately the NotesDOMParse can't read from an external address (like an URL or RSS feed) - so I have to use the Microsoft DOM Parser instead.
The function CreateDOM creates a handle to the MSXML.DomDocument and sets the defaults. Now, you just need to load the url and traverse the XML tree, with something like this:
Dim dom As Variant
Set dom = createDOM()
Call dom.load( url )
Dim root As Variant
Set root = dom.documentElement
'ready to go, root.childNodes links to all the elements....
Function createDOM() As Variant
'create Microsoft Dom Parser object (Domino can't read an url or use xPath searches)
Dim dom As Variant
'only use version 6 or 3
'http://blogs.msdn.com/xmlteam/archive/2006/10/23/using-the-right-version-of-msxml-in-internet-explorer.aspx
On Error Resume Next
Set dom = CreateObject( "MSXML2.DOMDocument.6.0" )
If dom Is Nothing Then Set dom = CreateObject( "MSXML2.DOMDocument.3.0" )
If dom Is Nothing Then Set dom = CreateObject("Microsoft.XMLDOM")
On Error Goto 0
dom.async = False
dom.validateOnParse = False
Set createDOM = dom
End Function
Sunday, November 2, 2008
Subscribe to:
Post Comments (Atom)


2 comments:
Hi Jacob,
I was looking for something to read the XML from the URL and your code helped me.. Further I am not getting how to get the node values after Set root = dom.documentElement...
Can you please help...
Thanks in advance.
Best Regards,
Guru.
Hi,
You can download my RSS Reader database - it contains a lot of sample code you can use -> http://majkilde.com/hosting/majkilde/home.nsf/staticpages/rss!OpenDocument
Post a Comment