title: Xpath display correct results in XMLSpy but null in Java
body: <p>I am trying to display all text within text nodes only, within an XFA XML document while ignoring namespaces. </p>
  
  <p>I came up with an Xpath that returns the desired results within XMLSpy with xpath 1.0 but the same Xpath in Java returns <strong>null</strong> for some reason.  </p>
  
  <pre><code>Xpath = //*[local-name()='text'][string-length(normalize-space(.))&gt;0]
  </code></pre>
  
  <p><br/></p>
  
  <pre><code>    XPathFactory factory = XPathFactory.newInstance();
      XPath xpath = factory.newXPath();
      ArrayList&lt;String&gt; list = new ArrayList&lt;&gt;();
  
      XPathExpression expr = xpath.compile("//*[local-name()='text'][string-length(normalize-space(.))&gt;0]");
  
  
      NodeList nodes = (NodeList) expr.evaluate(doc, XPathConstants.NODESET);
      for (int i = 0; i &lt; nodes.getLength(); i++) {
          System.out.println("This prints null = " + nodes.item(i).getNodeValue());
      }
  </code></pre>
  
  <p>XML file wouldn't post here so it can be viewed at the link below:
  <a href="https://drive.google.com/file/d/1n-v3gzT-3GgxNnYKFUvMPjRQmtnkqcpY/view?usp=sharing" rel="nofollow noreferrer">https://drive.google.com/file/d/1n-v3gzT-3GgxNnYKFUvMPjRQmtnkqcpY/view?usp=sharing</a></p>