We are writing a LotusScript agent that will read in an XML string, create a DOM document, and modify the contents of some of the DOM document element nodes.
Using an output stream (associated with a hardcoded file name) and either the DOMParser Serialize or Output methods, we can regenerate a string of XML data from the modified DOM document.
But we really want to generate the modified XML string to the agent’s standard output (e.g., like using a Print statement to write to a browser) rather than to a file defined by an output stream. The DOMParser class has no toString method, and we have not found any way to generate the XML string to standard output.
Is there some other processing alternative?
Subject: You should be able to cannibalize something from here
Sub Initialize
Dim doc As NotesDocument
Dim exporter As NotesDXLExporter
Dim nnc As NotesNoteCollection
Dim nstream As NotesStream
Dim parser As NotesDOMParser
Dim rti As NotesRichTextItem
Dim thisns As New NotesSession
Set nnc = thisns.CurrentDatabase.CreateNoteCollection( False )
Call nnc.SelectAllDesignElements( True )
nnc.SelectReplicationFormulas = True
Call nnc.BuildCollection
Set parser = thisns.CreateDOMParser
Set exporter = thisns.CreateDXLExporter( nnc , parser )
Call exporter.Process
Set doc = thisns.CurrentDatabase.CreateDocument
Set rti = doc.CreateRichTextItem( "Body" )
Call parser.SetOutput( rti )
Call parser.Serialize
’ Print rti.GetUnformattedText ’ careful with this one.
End Sub