title: XPath can't find a table by id
body: <p>I'm doing some screen scraping using WATIJ, but it can't read HTML tables (throws NullPointerExceptions or UnknownObjectExceptions).  To overcome this I read the HTML and run it through JTidy to get well-formed XML.</p>
  
  <p>I want to parse it with XPath, but it can't find a <code>&lt;table ...&gt;</code> by <code>id</code> even though the table is there in the XML plain as day.  Here is my code:</p>
  
  <pre><code>XPathFactory factory=XPathFactory.newInstance();  
  XPath xPath=factory.newXPath();  
  InputSource inputSource = new InputSource(new StringReader(tidyHtml));  
  XPathExpression xPathExpression=xPath.compile("//table[@id='searchResult']");  
  String expression = "//table[@id='searchResult']";
  String table = xPath.evaluate(expression, inputSource);
  System.out.println("table = " + table);
  </code></pre>
  
  <p>The table is an empty String.</p>
  
  <p>The table is in the XML, however.  If I print the <code>tidyHtml</code> String it shows</p>
  
  <pre><code> &lt;table
     class="ApptableDisplayTag"
     id="searchResult"
     style="WIDTH: 99%"&gt;
  </code></pre>
  
  <p>I haven't used XPath before so maybe I'm missing something.</p>
  
  <p>Can anyone set me straight? Thanks.</p>