22 $this->doc =
new DOMDocument();
28 public function __call($a_method, $a_args)
30 if (in_array($a_method, array(
"validate",
"loadXML")))
32 set_error_handler(array($this,
"handleError"));
33 $rv = call_user_func_array(array($this->doc, $a_method), $a_args);
34 restore_error_handler();
39 return call_user_func_array(array($this->doc, $a_method), $a_args);
48 if ($a_mem ==
"errors")
54 return $this->doc->$a_mem;
61 public function __set($a_mem, $a_val)
63 $this->_delegate->$a_mem = $a_val;
69 public function handleError($a_no, $a_string, $a_file = null, $a_line = null, $a_context = null)
71 $pos = strpos($a_string,
"]:");
72 $err = trim(substr($a_string, $pos + 2));
73 $this->errors[] =
$err;