23 function staticxmlerror(
int $errno,
string $errstr, ?
string $errfile = null, ?
int $errline = null, ?array $errcontext = null,
bool $ret =
false)
25 static $errs = array();
27 $tag =
'DOMDocument::validate(): ';
28 $errs[] = str_replace($tag,
'', $errstr);
35 define(
'DOMXML_LOAD_PARSING', 0);
60 public function __construct($source, $file =
true, $a_mode = 0)
64 set_error_handler(
'staticxmlerror');
65 $old = ini_set(
'html_errors',
false);
67 if (is_object($source)) {
68 $this->myDOMDocument = $source;
72 $this->
success = @$this->myDOMDocument->load($source, $a_mode);
74 $this->
success = $this->myDOMDocument->loadXML($source, $a_mode);
79 ini_set(
'html_errors', $old);
80 restore_error_handler();
84 foreach ($this->error_arr as $error) {
85 $error = str_replace(
"DOMDocument::loadXML():",
"", $error);
86 $this->error .= $error .
"<br />";
DOMDocument $myDOMDocument
domxml_open_mem($str, $mode=0, &$error=null)
staticxmlerror(int $errno, string $errstr, ?string $errfile=null, ?int $errline=null, ?array $errcontext=null, bool $ret=false)
__construct($source, $file=true, $a_mode=0)