troubleshooting Question

SelectNodes strange problem

Avatar of keimpe
keimpe asked on
XML
2 Comments1 Solution255 ViewsLast Modified:
Dear everyone,

I'm trying to import Goldmine data into MS Access. Goldmine has an XML export feature, so I'm trying to import those XML files using VBA code.

When I use the following code, it works on the one file and doesn't on the other. The XML files are exported using identical settings. One file contains Goldmine Email messages for the month of May en the other for the month of July. May gets imported and July doesn't (and yes, I have tried to recreate these files a number of times).

Here's my code (please correct any mistakes - I am an XML amateur):

[code begin]
   Dim xmlDoc As MSXML2.DOMDocument30
   Dim objListOfNodes As IXMLDOMNodeList
   Dim objNode As IXMLDOMNode
   
   Set xmlDoc = New DOMDocument30
   
   xmlDoc.async = False
   xmlDoc.validateOnParse = False
   xmlDoc.Load ("E:\Goldmine\Import\July.xml")
   
   Set objListOfNodes = xmlDoc.selectNodes("//gmdata/accounts/*")
   For Each objNode In objListOfNodes
                           ----- rest of code -----
   Next
[code end]

With the one file, all goes well. With the other file, no objNode is found so the code skips to the end without errors.

I've opened the XML files in a text editor and they look just fine to me. The nodes I want are present.

(BTW I have this problem with other files as well, I've just restricted it to May.xml and July.xml to keep it simple here).
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros