Skip to content

Commit

Permalink
Adding loadHTML and loadXML
Browse files Browse the repository at this point in the history
  • Loading branch information
phayes committed Apr 26, 2017
1 parent cb2a56a commit 36b2f48
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/DOMDoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,20 @@ public static function loadFile($file_or_url, $auto_register_namespaces = TRUE)
return new DOMDoc($dom, $auto_register_namespaces);
}

public function loadHTML($source, $options = NULL) {
$success = parent::loadHTML($source, $options);
$this->AutoRegisterNamespace(TRUE);

return $success;
}

public function loadXML($source, $options = NULL) {
$success = parent::loadXML($source, $options);
$this->AutoRegisterNamespace(TRUE);

return $success;
}

private function AutoRegisterNamespace($auto_register_namespaces) {
$this->auto_ns = TRUE;

Expand Down

0 comments on commit 36b2f48

Please sign in to comment.