title: VBScript Can not Select XML nodes
body: <p>I am trying to Select nodes from some webservice response XML to no avail. For some reason I am able to select the root node ("xmldata") however, when I try to drill deeper("xmldata/customers") everything is returned empty! Below is the a sample of the XML that is returned by the webservice.</p>
  
  <pre><code>&lt;xmldata&gt;
    &lt;customers&gt;
      &lt;customerid&gt;22506&lt;/customerid&gt;
      &lt;firstname&gt;Jim&lt;/firstname&gt;
      &lt;issuperadmin&gt;N&lt;/issuperadmin&gt;   
      &lt;lastname&gt;Jones&lt;/lastname&gt;
    &lt;/customers&gt;
  &lt;/xmldata&gt;
  </code></pre>
  
  <p>and here is the code I am trying to select customerid, firstname, and lastname;</p>
  
  <pre><code>' Send the Xml
  oXMLHttp.send Xml_to_Send
  
  ' Validate the Xml
  dim xmlDoc
  set xmlDoc = Server.CreateObject("Msxml2.DOMDocument")
  xmlDoc.load (oXMLHttp.ResponseXML.text)
  if(len(xmlDoc.text) = 0) then
      Xml_Returned = "&lt;B&gt;ERROR in Response xml:&lt;BR&gt;ERROR DETAILS:&lt;/B&gt;&lt;BR&gt;&lt;HR&gt;&lt;BR&gt;" 
  end if
  
  dim nodeList
  Set nodeList = xmlDoc.SelectNodes("xmldata/customers")
  
  For Each itemAttrib In nodeList
      dim custID, custLname, custFname    
      custID =itemAttrib.selectSingleNode("customerid").text
      custLname =itemAttrib.selectSingleNode("lastname").text
      custFname =itemAttrib.selectSingleNode("firstname").text
      response.write("News Subject: " &amp; custID)
      response.write("&lt;br /&gt;News Subject: " &amp; custLname)
      response.write("&lt;br /&gt;News Date: " &amp; custFname)
  Next
  </code></pre>
  
  <p>The result of the code above is zilch! nothing is written to the page. One strange thing is if I select the root element and get its length as follows;</p>
  
  <pre><code>Set nodeList = xmlDoc.SelectNodes("xmldata")
  Response.Write(nodeList.length) '1 is written to page
  </code></pre>
  
  <p>It correctly determines the length of 1. However when I try the same with the next node down as follows;</p>
  
  <pre><code>Set nodeList2 = xmlDoc.SelectNodes("xmldata/customers")
  Response.Write(nodeList.length) '0 is written to page
  </code></pre>
  
  <p>It returns a length of 0. WHY!</p>
  
  <p>Please note that this isn't the only way I have attempted to access the values of these nodes. I just can not work out what I am doing wrong. Could someone please help me out. Cheers. </p>