title: java: xpath expression with namespace
body: <p>I'm trying to extract an portion of xml using this code:</p>
  <pre class="lang-java prettyprint-override"><code>DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
  DocumentBuilder builder = factory.newDocumentBuilder();
  Document doc = builder.parse(responseStream);
  
  XPathFactory xPathfactory = XPathFactory.newInstance();
  XPath xpath = xPathfactory.newXPath();
  XPathExpression expr = xpath.compile(&quot;//[local-name()='UpdateResponseDocument']&quot;);
  </code></pre>
  <p>As you can see, I'm using <code>local-name</code>.</p>
  <p>I'm getting this exception:</p>
  <blockquote>
  <p>Caused by: javax.xml.transform.TransformerException: A location step was expected following the '/' or '//' token.</p>
  </blockquote>
  <p>My xml is:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;
    &lt;soap:Body&gt;
      &lt;ns2:cercarInformacioPacientResponseV2 xmlns:ns2=&quot;http://salut.gencat.cat/hc3/etccerques&quot; xmlns:ns3=&quot;urn:hl7-org:v3&quot; xmlns:ns4=&quot;http://principal.agenda.consulta.ws.hc3.salut.cat/&quot;&gt;
        &lt;ns2:UpdateResponseDocument&gt;
          &lt;idMissatge&gt;123456789
          &lt;/idMissatge&gt;
          &lt;resultCode&gt;OK
          &lt;/resultCode&gt;
          &lt;result&gt;
            &lt;executionCode&gt;ETC_OIP_000
            &lt;/executionCode&gt;
            &lt;executionDetails&gt;El procés s'ha dut a terme correctament.
            &lt;/executionDetails&gt;
            &lt;pacient&gt;
              ...
            &lt;/pacient&gt;
          &lt;/result&gt;
        &lt;/ns2:UpdateResponseDocument&gt;
      &lt;/ns2:cercarInformacioPacientResponseV2&gt;
    &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  <p>Any ideas?</p>