domino 日常打卡-xml解析

其实在我们获取到domParser.Document方法后就可以用对象.来查看所有获取的方法,然后根据自己的需求来获取数据

解析xml的常用方法

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
REM
功能:将xml字符串转化为xml对象
%END REM
Function getdocflowxmltime(strXml As String ) As Double
On Error GoTo h
Dim session As New NotesSession
Dim domParser As NotesDOMParser '定义xml 文档对象
Dim documentList As NotesDOMNodeList
Dim eNode As NotesDOMElementNode
Dim i As Integer
Dim allstat As Double
'找到每条文档对应的意见文档
strXml = Replace(Replace(strXml,Chr(10),"") ,Chr(13),"")
If strXml <> "" Then
Set domParser=session.CreateDOMParser(strXml)
domParser.Process
Set documentList = domParser.Document.GetElementsByTagName ("NodeInfo") '根据实际需求来处理
For i = 1 To documentList.NumberOfEntries
Set eNode = documentList.GetItem(i)
'根据实际需求来解析
Next

End If


getdocflowxmltime=allstat


'msg(allstat)

Exit Function
h:
showerror("getdocflowxmltime")
End Function