Skip to content

Commit

Permalink
getErrors()
Browse files Browse the repository at this point in the history
  • Loading branch information
olamedia committed Mar 21, 2014
1 parent 4beaf25 commit 3683d11
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nokogiri.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ class nokogiri implements IteratorAggregate{
* @var DOMXpath
* */
protected $_xpath = null;
/**
* @var libxmlErrors
*/
protected $_libxmlErrors = null;
protected static $_compiledXpath = array();
public function __construct($htmlString = ''){
$this->loadHtml($htmlString);
Expand Down Expand Up @@ -91,10 +95,14 @@ public function loadHtml($htmlString = ''){
if (strlen($htmlString)){
libxml_use_internal_errors(true);
$dom->loadHTML($htmlString);
$this->_libxmlErrors = libxml_get_errors();
libxml_clear_errors();
}
$this->loadDom($dom);
}
public function getErrors(){
return $this->_libxmlErrors;
}
function __invoke($expression){
return $this->get($expression);
}
Expand Down

0 comments on commit 3683d11

Please sign in to comment.