Option Public Option Explicit Use "XmlNodeReader" Sub Initialize Dim session As New NotesSession Dim db As NotesDatabase Set db = session.CurrentDatabase '** get all the agents in this database Dim nc As NotesNoteCollection Set nc = db.CreateNoteCollection(False) nc.SelectAgents = True Call nc.BuildCollection '** export all the agents to a single DXL stream Dim stream As NotesStream Dim exporter As NotesDXLExporter Set stream = session.CreateStream Set exporter = session.CreateDXLExporter(nc, stream) Call exporter.Process Print "DXL size = " & Format(stream.Bytes, "#,#") stream.Position = 0 '** read the DXL stream into an XmlNodeReader Dim reader As New XmlNodeReader Call reader.ReadStream( stream ) If reader.isEmpty Then Messagebox "Error parsing DXL: " & reader.getLastError() Exit Sub End If '** get all the <agent> nodes and print the "name" attribute Dim i As Integer Dim arr As Variant '** if you don't know what the top-level node name is going to be, '** you can use getSubNodeNames() to figure it out arr = reader.getSubNodeNames( "" ) arr = reader.getNodeReaders( arr(0) & ".agent" ) For i = 0 To Ubound(arr) Print "Node #" & i+1 & " is an " & arr(i).thisNodeName & _ " node. Name = " & arr(i).get("@name") Next End Sub
This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.