title: Using XPath in XMLObject to query by namespace
body: <p>I have a simple XML document</p>
  
  <pre><code>&lt;abc:MyForm xmlns:abc='http://myform.com'&gt;
      &lt;abc:Forms&gt;
          &lt;def:Form1 xmlns:def='http://decform.com'&gt;
              ....
          &lt;/def:Form1&gt;
          &lt;ghi:Form2 xmlns:ghi='http://ghiform.com'&gt;
              ....
          &lt;/ghi:Form2&gt;
      &lt;/abc:Forms&gt;
  &lt;/abc:MyForm&gt;
  </code></pre>
  
  <p>I'm using XMLObjects from Apache and when I try to do the following xpath expression it works perfectly</p>
  
  <pre><code>object.selectPath("declare namespace abc='http://myform.com' 
                     abc:Form/abc:Forms/*");
  </code></pre>
  
  <p>this gives me the 2 Form nodes (def and ghi). However I want to be able to query by specifying a namespace, so let's say I only want Form2.  I've tried this and it fails</p>
  
  <pre><code>object.selectPath("declare namespace abc='http://myform.com' 
                     abc:Form/abc:Forms/*
                        [namespace-uri() = 'http://ghiform.com']");
  </code></pre>
  
  <p>The selectPath returns 0 nodes. Does anyone know what is going on?</p>
  
  <p>Update:</p>
  
  <p>If I do the following in 2 steps, then I can get the result that I want.</p>
  
  <pre><code> XmlObject forms = object.selectPath("declare namespace abc='http://myform.com' 
                     abc:Form/abc:Forms")[0];
   forms.selectPath("*[namespace-uri() = 'http://ghiform.com']");
  </code></pre>
  
  <p>this gives me the ghi:Form node just like it should, I don't understand why it doesn't do it as a single XPath expression though.
  Thanks</p>