title: parsing HTML file to DOM Tree for extract (Java)
body: <p>so I am trying to parse a HTML file into the DOM Tree and extract nodes via an XPath expression.</p>
  
  <p>I can successfully parse the HTML into the DOM Tree, however when I try to extract Nodes via XPath I am getting nothing out.</p>
  
  <p>Please <strong>note</strong> this is only a code snippet for relevance.</p>
  
  <pre><code>import org.cyberneko.html.parsers.DOMParser;
  import org.dom4j.Document;
  import org.dom4j.Node;
  import org.dom4j.io.DOMReader;
  import org.xml.sax.InputSource;
  
  DOMParser parser = new DOMParser();
  
  parser.parse(new InputSource("file:///Z:/homepage.htm"));
  org.w3c.dom.Document doc = parser.getDocument();
  
  DOMReader reader = new DOMReader();
  Document document = reader.read(doc);
  
  @SuppressWarnings("unchecked")
  List&lt;Node&gt; nodes = document.selectNodes("//HEAD/LINK");
  </code></pre>
  
  <p>nodes = 0.</p>
  
  <p>For completeness, here is a snippet of the HTML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;HTML xmlns="http://www.w3.org/1999/xhtml"&gt;
      &lt;HEAD&gt;
          &lt;META content="text/html;charset=UTF-8" http-equiv="Content-Type"/&gt;
          &lt;TITLE/&gt;
          &lt;LINK
              href="wcm/groups/visual/documents/webasset/####_ie_5_css.css"
              media="all" rel="stylesheet" type="text/css"/&gt;
          &lt;LINK
              href="wcm/groups/visual/documents/webasset/####_ie_5_5000_css.css"
              media="all" rel="stylesheet" type="text/css"/&gt;
          &lt;LINK
              href="wcm/groups/visual/documents/webasset/####_ie_6_css.css"
              media="all" rel="stylesheet" type="text/css"/&gt;
  </code></pre>
  
  <p>Many thanks as always,</p>
  
  <p>Joe</p>