关于Lotus的XML

我下面这段代码实现的功能:统计在线人数和人名,同一个人多个session时只认为一个用户;
问题是:“String tmpXML = s.SendConsoleCommand("","show inetusers -xml")”这句有没有可能造成tmpXML字段溢出,如果会是否有解决的方法,另外,我总觉的自己有点绕弯了,“s.SendConsoleCommand("","show inetusers -xml")”这个输出就应该是个xml对象了,但又不知如何用,该付给哪个对象,请大家帮忙指点一下,谢谢!

Dim domParser As NotesDOMParser 'xml对象
Dim domNodeList As NotesDOMNodeList 'name集
Dim domNode As NotesDOMNode 'name
Dim domDocNode As NotesDOMDocumentNode 'dom树
Dim tmpStr As String '临时name值
Dim beforStr As String '前一个name值
Dim endStr As String '赛选后的所有name值
Dim endData As Variant '返回值
Dim tmpXML As String '执行完命令后得到的XML
Dim num,ii As Integer

On Error Goto errHandle
tmpXML = s.SendConsoleCommand("","show inetusers -xml")
Set domParser = s.CreateDOMParser(tmpXML)
domParser.Process

Set domDocNode = domParser.Document
Set domNodeList = domDocNode.GetElementsByTagName("name") '获取所有name标签集
num = 0
For ii=1 To domNodeList.NumberOfEntries
Set domNode = domNodeList.GetItem(ii)
tmpStr = domNode.FirstChild.NodeValue
If tmpStr<>"" Then
If beforStr<> tmpStr Then '过滤重复人员
beforStr = tmpStr
If Instr(endStr,tmpStr)<1 Then
endStr = tmpStr+";"+endStr
num = num+1
End If
End If
End If

Next

你可能感兴趣的:(xml)