title: XPath Fails with MSXML2
body: <p>I'm using VBA to parse the soap xml with MSXML2 and XPath but while the XPath query works in various tools it doesn't select anything in the selectNodes method. From what I've gathered from the numerous questions I've seen so far, I can use this 'local-name' syntax instead of specifying a namespace but nothing is ever selected. What am I doing wrong?</p>
  
  <pre><code>private const DQ = """"
  Public Sub parseXML(sFileName As String)
  Dim xmldoc As New MSXML2.DOMDocument60, I As IXMLDOMNodeList, x As IXMLDOMNode
  
  With xmldoc
    .loadXML sFileName
    .SetProperty "SelectionLanguage", "XPath"
    Set I = .selectNodes("//*[local-name()=" &amp; DQ &amp; "item" &amp; DQ &amp; "]")
    If I.length &gt; 0 Then 
      ' do something useful
    end if
  End With
  End Sub
  
  
  &lt;soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"&gt;
   &lt;soap-env:Header&gt;&lt;/soap-env:Header&gt;
   &lt;soap-env:Body&gt;
    &lt;n0:ZBexQaasResponse xmlns:n0="urn:sap-com:document:sap:soap:functions:mc-style"&gt;
     &lt;Messages&gt;
      &lt;item&gt;
        // some elements
      &lt;/item&gt;
     &lt;/Messages&gt;
     &lt;OutputTable&gt;
      &lt;item&gt;
       // some elements
      &lt;/item&gt;
     &lt;/OutputTable&gt;
     &lt;TextElements&gt;&lt;/TextElements&gt;
     &lt;XmlOutput&gt;&lt;/XmlOutput&gt;
     &lt;XmlTxtelem&gt;&lt;/XmlTxtelem&gt;
    &lt;/n0:ZBexQaasResponse&gt;
   &lt;/soap-env:Body&gt;
  &lt;/soap-env:Envelope&gt;
  </code></pre>