Results 1 to 5 of 5

Thread: [RESOLVED] Object variable not set error while loading xml in domdocument

  1. #1

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    40

    Resolved [RESOLVED] Object variable not set error while loading xml in domdocument

    Dim strRelsAttrXML As String
    Dim xdcAttrDoc As New MSXML2.DOMDocument

    strRelsAttrXML = "<SText>bit.test_report_&_msg_in</SText>"
    xdcAttrDoc.loadXML (strRelsAttrXML)
    x = xdcAttrDoc.childNodes(0).Text
    MsgBox x


    Hi

    Above code is not working as there is & in node text .
    Help neeed. Urgent...

    Thanks in advance

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Object variable not set error while loading xml in domdocument

    It doesn't matter where you post it, the problem comes back to strRelsAttrXML containing an unescaped ampersand and therefore it is not valid XML.

  3. #3

  4. #4

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    40

    Re: Object variable not set error while loading xml in domdocument

    solved the problem by repalcing & in the node text with amp;

  5. #5
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Object variable not set error while loading xml in domdocument

    Now that we've helped you, you can help us by pulling down the Thread Tools menu and clicking the Mark Thread Resolved button which will let everyone know that you have your answer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width