Lotus Notes, Sametime and Java working together

Sametime and Domino solutions
Lotus Notes/Domino and Sametime software made easy

Get notification about


Simple XML downloader and processor

This LotusScript agent downloads XML data from web, parses it and then and shows parsed result in a message box.

Sub Initialize
Dim objHttp, i

Set objHttp = CreateObject("Microsoft.XMLHTTP")
url = |http://www-10.lotus.com/ldd/nd6forum.nsf/DateAllThreadedweb?readviewentries&count=3| ' get 3 first entries from the view
req = |<?xml version="1.0" encoding="UTF-8" ?><test>iiii</test><test2>cccccc</test2>| 'specify payload
objHttp.open "POST", url, False, "", ""
objHttp.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
objHttp.send(req) 'send request to web server
Set xmlDoc = CreateObject("Msxml2.DOMDocument")
xmlDoc.loadXML (objHttp.ResponseText)
Set xmlLst = xmlDoc.getElementsByTagName("viewentry") 'get all XML elements which are called viewentry. There is 1 entry per document.
For i = 0 To xmlLst.length - 1
Set xmlNode = xmlLst.Item(i)
Set att=xmlnode.childnodes
Forall child In att
tmp=tmp+" "+child.text 'child.nodename+"="+child.text
End Forall
tmp=tmp+ Chr(10)+Chr(13) 'separate with new line
Msgbox tmp
End Sub

Example output from this agent:

© Copyright 2004. Botstation