title: Delphi - Invalid namespace URI in IXMLNode
body: <p>I am trying to parse a response from a SOAP web service, but part of the data has an invalid xmlns element and I think it is causing me no end of trouble.</p>
  
  <p>The part of the XML that I am working with is as follows.</p>
  
  <pre><code>&lt;soap:Body xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;ResponseData xmlns="http://www.example.com/WebServices/Schemas/1"&gt;
          &lt;ResponseDataResult&gt;
              &lt;Messages xmlns="http://www.example.com/WebServices/Schemas/2"&gt;
                  &lt;Message&gt;...&lt;/Message&gt;
              &lt;/Messages&gt;
          &lt;/ResponseDataResult&gt;
          ...
      &lt;/ResponseData&gt;
  &lt;/soap:Body&gt;
  </code></pre>
  
  <p>The xmlns URI in the soap:Body node is OK, its the one in ResponseData that is invalid, it points to a none existent document. It should be noted that the web service is not under my control so fixing this is out of the question :(.</p>
  
  <p>my Delphi (2007) code look, at present, something like this.</p>
  
  <pre><code>var l_tmp,l_tmp2,FSOAPBody:IXMLNode;
  
  begin
      ...
  
      FSOAPBody := FSOAPEnvelope.ChildNodes.FindNode('Body','http://schemas.xmlsoap.org/soap/envelope/');
      //returns the xml above.
      if (FSOAPBody = nil) then exit;
  
      l_tmp := FSOAPBody.ChildNodes.FindNode('ResponseData','');
      if (l_tmp = nil) or (not l_tmp.HasChildNodes) then exit;
  
      l_tmp2 := l_tmp.ChildNodes.FindNode('ResponseDataResult','');
  
      ...
  end;
  </code></pre>
  
  <p>In the above code, I have had to add the blank namespace url to the <code>FindNode('ResponseData','')</code> code as with out it, it will not find anything and returns nil, with it however it reutrns the expected XML.</p>
  
  <p>The problem is that the next find node (<code>ChildNodes.FindNode('ResponseDataResult','')</code>) raises an access violation when trying to access the ChildNodes of l_tmp, I can look at the xml using l_tmp.xml and see that it is the XML I would expect.</p>
  
  <p>I suspect that it is due to the missing namespace, so I have tried to remove it, but get more errors saying it is a read-only attribute.</p>
  
  <p>Is there anyway to remove the xmlns attribute or select nodes regardless of there NS? or am I going about this wrong?</p>