title: Skip xml "premature end of data" error
body: <p>I have a faulty xml feed. It cuts off some of the nodes, they are broken and I get the following errors messages -</p>
  
  <pre><code>Warning: DOMDocument::load() [function.DOMDocument-load]: Premature end of data in tag 
  
  hotelDescription line 30760 in /srv/disk9/561574/www/source.xml, line: 30760 in /srv/disk9/561574/www/file.php on line 22
  
  Warning: DOMDocument::load() [function.DOMDocument-load]: Premature end of data in tag product line 30741 in /srv/disk9/561574/www/source.xml, line: 30760 in /srv/disk9/561574/www/file.php on line 22
  
  Warning: DOMDocument::load() [function.DOMDocument-load]: Premature end of data in tag products line 2 in /srv/disk9/561574/www/source.xml, line: 30760 in /srv/disk9/561574/www/file.php on line 22
  0
  </code></pre>
  
  <p>I have setup an error handler but I'm not sure how to, or if it is even possible, to ignore an element if it causes an error? </p>
  
  <pre><code>/* load the file on the DOM*/
  $dom = new DomDocument();
  $dom-&gt;load($filename);
  
  if (!$dom-&gt;load($filename)) {
      foreach (libxml_get_errors() as $error) {
          // handle errors here
  
      }
  
      libxml_clear_errors();
  }
  </code></pre>
  
  <p>Any help greatly appreciated, thanks.</p>