title: libxml HTML parsing error in C
body: <p>This is the HTML file that i tried to parse with libxml</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
           &lt;title&gt;Hello World Page&lt;/title&gt;
           &lt;link rel="stylesheet" type="text/css" href="http://csszengarden.com/214/214.css?v=8may2013"&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h3&gt;Hello World&lt;/h3&gt;
      &lt;br&gt;
      &lt;p&gt;Questo e un paragrafo.&lt;/p&gt;
      &lt;a src="/"&gt;LINK&lt;/a&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and this is the example program that I have took from the libxml parsing tutorial.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;libxml/parser.h&gt;
  #include &lt;libxml/tree.h&gt;
  
  static void print_element_names(xmlNode * a_node);
  
  int main()
  {
    xmlDoc         *doc = NULL;
    xmlNode        *root_element = NULL;
    const char     *Filename = "file.xml";
    doc = xmlReadFile(Filename, NULL, 0);
  
    if (doc == NULL) printf("error: could not parse file %s\n", Filename);
    else
    { root_element = xmlDocGetRootElement(doc);
      print_element_names(root_element);
      xmlFreeDoc(doc); }
    xmlCleanupParser();
    return (0);
  }
  
  static void print_element_names(xmlNode * a_node)
  {
    xmlNode *cur_node = NULL;
    for (cur_node = a_node; cur_node; cur_node = cur_node-&gt;next) {
        if (cur_node-&gt;type == XML_ELEMENT_NODE)
            printf("node type: Element, name: %s\n", cur_node-&gt;name);
        print_element_names(cur_node-&gt;children);
    }
  }
  </code></pre>
  
  <p>return me this series of error</p>
  
  <pre><code>file.xml:5: parser error : Opening and ending tag mismatch: link line 4 and head
      &lt;/head&gt;
             ^
  file.xml:11: parser error : Opening and ending tag mismatch: br line 8 and body
      &lt;/body&gt;
             ^
  file.xml:12: parser error : Opening and ending tag mismatch: body line 6 and html
  &lt;/html&gt;
         ^
  file.xml:12: parser error : Premature end of data in tag head line 2
  &lt;/html&gt;
         ^
  file.xml:12: parser error : Premature end of data in tag html line 1
  &lt;/html&gt;
         ^
  error: could not parse file file.xml
  </code></pre>
  
  <p>I'm a noob of libxml and i would generate and extract data from a tree based on the HTML file. What i have to modify in the program for parse the HTML code?</p>