title: Parse XML File with VBA
body: <p>I have a XML file with a structure similar to this:</p>
  
  <pre><code>&lt;egh_eval&gt;
  &lt;eval_set&gt;
      &lt;eval_id&gt;FLOAT&lt;/eval_id&gt;
      &lt;eval_d&gt;
          &lt;height&gt;INT&lt;/height&gt;
          &lt;weight&gt;INT&lt;/weight&gt;
      &lt;/eval_d&gt;
      &lt;eval_e&gt;
          &lt;height&gt;INT&lt;/height&gt;
          &lt;weight&gt;INT&lt;/weight&gt;
      &lt;/eval_e&gt;
      &lt;eval_cred&gt;
          &lt;credit&gt;FLOAT&lt;/credit&gt;
      &lt;/eval_cred&gt;
  &lt;/eval_set&gt;
  </code></pre>
  
  <p></p>
  
  <p>I need to parse the complete file and put it in a table. (Note: eval_d and eval_e actually have more than a hundred attributes each). I tried using MSXML2 however I get stuck when I try to parse the file. By using the answers at <a href="https://stackoverflow.com/questions/11305/how-to-parse-xml-in-vba">How to pase XML in VBA</a> and <a href="https://stackoverflow.com/questions/7271075/parse-xml-in-vba">Parse XML in VBA</a> I was able to get there :</p>
  
  <pre><code>Dim fSuccess As Boolean
  Dim oDoc As MSXML2.DOMDocument
  Dim oRoot As MSXML2.IXMLDOMNode ' Level 0 egh_eval
  Dim oChild As MSXML2.IXMLDOMNode ' Level 1 eval_set
  Dim oChildren As MSXML2.IXMLDOMNode ' Level 2 eval_id, eval_d, eval_e, eval_cred
  
  
  Dim domList As MSXML2.IXMLDOMNodeList
  
  Set oDoc = New MSXML2.DOMDocument
  oDoc.async = False
  oDoc.validateOnParse = False
  
  fSuccess = oDoc.Load(Application.CurrentProject.Path &amp; "\file.xml")
  
  Set oRoot = oDoc.documentElement
  Set oChild = oRoot.childNodes(0)
  Set oChildren = oChild.childNodes(0)
  
  For i = 0 To oChild.childNodes.length - 1
      For y = 0 To oChildren.childNodes.length - 1
          MsgBox oChildren.nodeName &amp; " : " &amp; oChildren.nodeTypedValue
          oChildren.childNodes.nextNode
      Next
      oChild.childNodes.nextNode
  Next
  </code></pre>
  
  <p>However, instead of giving me the right values, it gives me the float in eval_id 4 times...</p>
  
  <p>Thanks !</p>
  
  <p>EDIT: I am using Microsoft Access 2002 SP3</p>