Results 1 to 2 of 2

Thread: XML Load method Fails!

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 1999
    Location
    Belfast
    Posts
    254

    XML Load method Fails!

    Hi,
    I have a simple Load request from Vb reference MSXML 3.0 in project properties. When I run the code it cannot load the XML file. I am CERTAIN the path is correct. Has anyone seen this before. I have done this 100's of times on my old machine, but never on my new one. Am I missing something??

    I get a object not set when I try to look at node contents. The boolean returns false on load.

    Any help appreciated. This is incredibly annoying.



    Source:

    Public Function getXML()

    Dim xmlDoc As MSXML2.DOMDocument

    Set xmlDoc = New MSXML2.DOMDocument

    Dim xmlNodes As IXMLDOMNodeList

    Dim lb_loaded As Boolean

    lb_loaded = True

    xmlDoc.async = False

    lb_loaded = xmlDoc.Load("http://home_pc/myRequestTest/controls.xml")

    ' Retrieve the collection of nodes at pc/ram

    Set xmlNodes = xmlDoc.getElementsByTagName("mycontrols/control")

    ' And use the item property to retrieve the
    ' text from the mycontrols/control tag

    MsgBox xmlNodes.Item(0).Text


    End Function

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Feb 1999
    Location
    Belfast
    Posts
    254
    Sorry my fault, I user domdocument.parseError. A tag in my XML was not closed. Sorry for bother.

    Lenin

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