title: getelementsbytagname for xml response text not working
body: <p>I'm having trouble figuring out why my code isn't recognizing the tagname "HourlySchedule". When it gets to: <code>For Each HourlySchedule In Resp.getElementsByTagName("HourlySchedule")</code>, it will skip to the end instead of looping thru each tag. I've tried several different tag names and it doesn't seem to work. Any suggestions? </p>
  
  <p>My VBA code:</p>
  
  <pre><code>    Sub Button1_Click()
      Dim URL As String: URL = "webaddress here"
      Dim mfile As String
      mfile = "&lt;?xml version=" &amp; """" &amp; "1.0" &amp; """" &amp; "?&gt;&lt;Envelope xmlns=" &amp; """" &amp; "http://schemas.xmlsoap.org/soap/envelope/" &amp; """" &amp; "&gt;&lt;Header/&gt;&lt;Body&gt;&lt;QueryRequest xmlns=" &amp; """" &amp; "http://markets.midwestiso.org/dar/xml" &amp; """" &amp; "&gt;&lt;QueryMarketResults day=" &amp; """" &amp; "2017-03-05" &amp; """" &amp; "&gt;&lt;LocationName&gt;Rug&lt;/LocationName&gt;&lt;/QueryMarketResults&gt;&lt;/QueryRequest&gt;&lt;/Body&gt;&lt;/Envelope&gt;"
  
      Set Req = New WinHttp.WinHttpRequest
      With Req
          .Open "POST", URL, False
          .SetClientCertificate "CURRENT_USER\MY\name"
          .SetRequestHeader "content-type", "text/xml"
          .Send (mfile)
          .WaitForResponse
      End With
  
      Dim Resp As New MSXML2.DOMDocument60
      Resp.LoadXML Req.ResponseText
  
  if Resp.loadxml (Req.ResponseText) then
     MsgBox "ok" else
     MsgBox "err"
  end if
  
      Dim HourlySchedule As IXMLDOMNode
      For Each HourlySchedule In Resp.getElementsByTagName("HourlySchedule") ''this is where my problem is
      Debug.Print "test"
      Next HourlySchedule
      End Sub
  </code></pre>
  
  <p>Here is the xml i'm trying to parse:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;Body&gt;
          &lt;QueryResponse xmlns="http://markets.midwestiso.org/dart/xml"&gt;
              &lt;MarketResults day="2017-03-05"&gt;
                  &lt;Location name="OTP.RUGBY1_IBR"&gt;
                      &lt;HourlySchedule hour="1"&gt;
                          &lt;ClearedEnergy MW="-6" virtualMW="0" price="7" capped="false"/&gt;
                          &lt;ClearedReg MW="0" price="10.18" capped="false"/&gt;
                          &lt;ClearedSpin MW="0" price="1" capped="false"/&gt;
                          &lt;ClearedSupp MW="0" price="0.5" capped="false"/&gt;
                          &lt;ClearedRampCapabilityUp MW="0" price="0"/&gt;
                          &lt;ClearedRampCapabilityDown MW="0" price="0"/&gt;
                      &lt;/HourlySchedule&gt;
                      &lt;HourlySchedule hour="2"&gt;
                          &lt;ClearedEnergy MW="-2" virtualMW="0" price="5.3" capped="false"/&gt;
                          &lt;ClearedReg MW="0" price="8.06" capped="false"/&gt;
                          &lt;ClearedSpin MW="0" price="1" capped="false"/&gt;
                          &lt;ClearedSupp MW="0" price="0.5" capped="false"/&gt;
                          &lt;ClearedRampCapabilityUp MW="0" price="0"/&gt;
                          &lt;ClearedRampCapabilityDown MW="0" price="0"/&gt;
                      &lt;/HourlySchedule&gt;
                  &lt;/Location&gt;
              &lt;/MarketResults&gt;
          &lt;/QueryResponse&gt;
      &lt;/Body&gt;
  &lt;/Envelope&gt;
  </code></pre>