Thursday, May 23, 2013

Read the XML in Lotus Notes

Really very hard to understand the structure of the Notes XML parsing classes. Still I need to understand more. Actually I tried to read the xml file for some requirement.

Initially I thought it is an easy job but after an half of the day had gone, I realized it is difficult one.

If someone has nice trick please share to me...

    Dim session As New NotesSession
    Dim domparser As NotesDOMParser
    Dim domdoc As NotesDOMDocumentNode
    Dim domlist As NotesDOMNodeList
    Dim domlist1 As NotesDOMNodeList
    Dim domele As NotesDOMElementNode
    Dim stream As NotesStream
    Dim node As NotesDOMNode
    Dim node1 As NotesDOMNode
    Dim x As String   
    x= "D:\javap\Test.xml"
    Set stream = session.CreateStream()
    stream.open(x)
    Set domParser = session.CreateDOMParser(stream)
    domParser.Process
    Set domdoc = domparser.Document
    Set domele = domparser.Document.DocumentElement
    Set domlist = domele.GetElementsByTagName("TagName")
    Set node =  domlist.GetItem(1)
    Msgbox node.FirstChild.NodeValue
 

5 comments:

  1. I have used Paul Cables code here : http://paul-cable.blogspot.co.uk/2011/04/xml-part-one-script-library.html

    I also recently came across this code by Julian Robichaux. Julian's stuff is always very good.
    http://www.nsftools.com/tips/XmlNodeReader/

    ReplyDelete
  2. I second Sean's endorsement of Julian Robichaux's XmlNodeReader. I've used it on many projects.

    (btw - your sign in restrictions to reply are rather tight. I understand not wanting comment spam, but you lose a lot with your limited login options)

    ReplyDelete
  3. @Brian Moore:- Thanks for your suggestion, Done... :)

    ReplyDelete
  4. @Sean Cull:- Nice referrence, Really impressed.,

    ReplyDelete
  5. @Ramkumar You found how to read XML in lotusScript, the XmlNodeReader class sent me an error, you can help me by sending an example to my email 303fabian@gmail.com.

    Thanks in advance. regards

    ReplyDelete