So I don’t forget the next time I want to do this, and trust me, I got a short memory!
Dim xml As String
Dim rootElementNode As NotesDOMElementNode
xml = "YOUR XML HERE"
Set rootElementNode = parseXML(xml)._
getElementsByTagName("THE ROOTNODE").getItem(1)
Public Function parseXML(xml As String) _
As NotesDOMDocumentNode
' Parses the specified xml.
On Error Goto catch
Dim session As New NotesSession()
Dim stream As NotesStream
Set stream = session.createStream()
Call stream.writeText(xml)
Dim domparser As NotesDOMParser
Set domparser = session.createDOMParser(stream)
domParser.exitOnFirstFatalError = True
Call domParser.parse()
Set parseXML = domparser.Document
Exit Function
catch:
Error Err, _
Err & "|" & Error & "|" & Lsi_info(2) & ":" & Erl
End Function
the idea is allways same
i seen this code in too many places…
but i can’t make it works.
is needed some library declartion???
ps: I changed this
xml = ”YOUR XML HERE”
and
THE ROOTNODE
What errors do you get? Do you include the XML processing instruction at the top? Is it valid XML?
Johan,
thanks for help, and the fast answer…
now works