title: Delphi/MSXML: XPath queries fail
body: <p>I've loaded a XML document, and now I wish to run a XPath query to select a certain subset of the XML. The XML is</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;catalog xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'&gt;
     &lt;book id="bk101"&gt;
        &lt;author&gt;Gambardella, Matthew&lt;/author&gt;
        &lt;title&gt;XML Developer's Guide&lt;/title&gt;
        &lt;genre&gt;Computer&lt;/genre&gt;
        &lt;price&gt;44.95&lt;/price&gt;
        &lt;publish_date&gt;2000-10-01&lt;/publish_date&gt;
        &lt;description&gt;An in-depth look at creating applications with
        XML.&lt;/description&gt;
     &lt;/book&gt;
  &lt;/catalog&gt;
  </code></pre>
  
  <p>and the procedure goes something like</p>
  
  <pre><code>procedure RunXPathQuery(XML: IXMLDOMDocument2; Query: string);
  begin
  
    XML.setProperty('SelectionLanguage', 'XPath');
  
    NodeListResult := XML.documentElement.selectNodes(Query));
  
    ShowMessage('Found (' + IntToStr(NodeListResult.length) + ') nodes.');
  
  end;
  </code></pre>
  
  <p>Problem is: when I run the XPath query '/catalog' for the above XML, it returns (as expected) a nodelist of 1 element. However, if I remove <code>:xsi</code> from 
  <code>&lt;catalog xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'&gt;</code> and re-run the query, the nodelist returned is empty. If I remove the entire 'xmlns'-attribute, the resulting nodelist has, once again, 1 element. </p>
  
  <p>So my question is this: what can I do to remedy this, i.e. how do I make MSXML return the correct number of instances (when running a XPath query), regardless of the namespace (or other attributes)?</p>
  
  <p>Thanks!</p>