Printing headers in LotusScript
' HTML
Print "Content-Type:text/html"
Print "<body text="000000" bgcolor='ffffOO'>"
Print "Agent Ran"
' XML
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim view As NotesView
Set db = s.currentDatabase
Set view = db.GetView( "XML" )
Set doc = view.GetFirstDocument
Print "Content-type: text/xml"
'Prevents Domino from sending default headers.
Print "<BOOKCATALOG>"
'BOOKCATALOG is the root element of the XML document.
While Not ( doc Is Nothing )
'Loop as long as there are document objects available.
Print "<BOOK>"
'Send the parent element for each book document.
Print "<bookTitle>"+doc.bookTitle(0)+"</bookTitle>"
Print "<bookAuthor>"+doc.bookAuthor(0)+"</bookAuthor>"
Print "<bookPrice>"+doc.bookDiscountPrice(0)+"</bookPrice>"
Print "<bookCategory>"+doc.bookCategory(0)+"</bookCategory>"
Print "</BOOK>"
'Close the book element tag.
Set doc = view.GetNextDocument( doc )
'Get the next document in the view.
Wend
Print "</BOOKCATALOG>"
'Closes the root element.