Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, UK, Berkshire, England
    Posts
    243
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MSXML 4.0 SelectSingleNode (VB6 SP5)

    Has anyone had problems with this function ?
    I get a error 91 on the With node.ChildNodes line when I use it with a DOMDocument4.0, but if I go back to using a DOMDocument3.0 it works fine?

    Option Explicit

    Private Sub Command1_Click()

    Dim xmlDoc As New MSXML2.DOMDocument30
    'Dim xmlDoc As New MSXML2.DOMDocument40

    xmlDoc.async = False
    'xmlDoc.setProperty "SelectionLanguage", "XPath"

    xmlDoc.Load (App.Path & "nlis.xml")
    If xmlDoc.parsed = True Then
    Debug.Print "Loaded " & App.Path & "nlis.xml"
    Else
    Debug.Print "Error " & xmlDoc.parseError.reason
    End If

    If GetTestValues(xmlDoc) Then
    Debug.Print "got values"
    Else
    Debug.Print "problem"
    End If

    Set xmlDoc = Nothing

    End Sub

    'Public Function GetTestValues(pxmlReceive As MSXML2.DOMDocument40) As Boolean
    'Dim mpxmlReceive As MSXML2.DOMDocument40
    Public Function GetTestValues(pxmlReceive As MSXML2.DOMDocument30) As Boolean
    Dim mpxmlReceive As MSXML2.DOMDocument30
    Dim node As MSXML2.IXMLDOMNode
    Dim node2 As MSXML2.IXMLDOMNode

    Set mpxmlReceive = pxmlReceive

    Debug.Print "Start loop "
    Set node = mpxmlReceive.selectSingleNode("//ROAD_SEARCH_ENTRY")
    With node.childNodes
    .Reset
    Set node2 = .nextNode
    Do While Not node2 Is Nothing
    Select Case node2.baseName
    Case "OTHER_USRN"
    Debug.Print "usrn " & node2.Text
    Case "OTHER_ROADS_AND_FOOTWAYS"
    '
    Case "ADDITIONAL_QUESTION"
    '
    Case Else
    '
    End Select
    Set node2 = .nextNode
    If node2 Is Nothing Then
    GoTo PROCEXIT
    End If
    Loop
    End With

    PROCEXIT:
    Debug.Print "Finished"

    GetTestValues = True

    End Function

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MSXML 4.0 SelectSingleNode (VB6 SP5)

    Do you have both library references loaded at the same time and are switching back and forth, or do you unload one before loading the other?

    Having two versions of an object model reference library loaded at the same time can cause some weird problems.

    I espick from espeeriance...

    I am interested in how you are using XML. What is the library reference to access the object model? Is it available (that is, a part of a standard Windows/IE install) or do you have to download the library to get at it?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, UK, Berkshire, England
    Posts
    243
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MSXML 4.0 SelectSingleNode (VB6 SP5)

    Nope, the only reference was to Microsoft XML, v4.0 (which is msxml4.dll)
    The only change to make the program work was the commenting out of the Document40 versus Document30, no changes to the referenced DLL
    Just getting started on using XML, hah, wish work had sent me on at least some training, I feel that a lot of my problems are 'known' issues that an expert would answer easily, but takes me a lot of time to find by looking through books and web searches.

    I got the MSXML 4.0 RTM parser from the Microsoft site at http:// http://msdn.microsoft.com/downloads/defaul...ompositedoc.xml

    Not standard (yet) in Windows/IE - just checked the Microsoft DLL Database (well recommended) at http://support.microsoft.com/servicedesks/...nfo.asp?sd=TECH
    and it shows that even WinXP only ships with the 3.0 parser, and in fact a search for msxml4* doesn't get any hits, so maybe the RTM status means that I should go back to using the MSXML 3.0 for the time being <img src=/S/doh.gif border=0 alt=doh width=15 height=15>

    What am I using it for, taking a data query from an ASP page, posting it into our database, then pulling out the users response to the query, and posting it back to the originator, at least that's the goal <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MSXML 4.0 SelectSingleNode (VB6 SP5)

    Steve,

    Thanks for the info. The link to the 4.0 parser is busted, so either you typoed or 4.0 is sacked for a while. Good idea to stick with 3.0 then...
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: MSXML 4.0 SelectSingleNode (VB6 SP5)

    Try this link to 4.0: <A target="_blank" HREF=http://msdn.microsoft.com/downloads/sample.asp?url=/MSDN-FILES/027/001/766/msdncompositedoc.xml>Microsoft XML Core Services 4.0 RTM</A> dated 12/14/2001.

    Or this link to 3.0: <A target="_blank" HREF=http://msdn.microsoft.com/downloads/sample.asp?url=/MSDN-FILES/027/001/772/msdncompositedoc.xml>MSXML Parser 3.0 Service Pack 2 Release</A> dated 09/21/2001.

    This might also be fun: <A target="_blank" HREF=http://msdn.microsoft.com/downloads/sample.asp?url=/msdn-files/027/000/542/msdncompositedoc.xml>MSXML SDK 3.0 Release</A> dated 03/12/2001.

  6. #6
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, UK, Berkshire, England
    Posts
    243
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MSXML 4.0 SelectSingleNode (VB6 SP5)

    Sorry about that
    - first time I've tried adding a hyperlink, and I get it wrong <img src=/S/frown.gif border=0 alt=frown width=15 height=15>
    - Jefferson's got the same address, and he knows how to put the links in <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>
    Changed the reference in the test harness, the intermediate dll and my dll, and it works, so I'm <img src=/S/joy.gif border=0 alt=joy width=23 height=23> but <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

Posting Permissions

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