25    static $errs = array();
 
   31    $tag = 
'DOMDocument::validate(): ';
 
   32    $errs[] = str_replace(
$tag, 
'', $errstr);
 
   40define(
'DOMXML_LOAD_PARSING', 0);
 
   58function xpath_eval($xpath_context, $eval_str, $contextnode = 
null)
 
   60    return $xpath_context->query($eval_str, $contextnode);
 
   74        $this->myDOMAttr = $aDOMAttr;
 
   79        return $this->myDOMAttr->name;
 
   84        return $this->myDOMAttr->specified;
 
   89        return $this->myDOMAttr->value;
 
   99        parent::php4DOMNode($aDOMCDATASection);                                         
 
  100        $this->myDOMCDATASection = $aDOMCDATASection;
 
  111        $this->myDOMDocument = 
new DOMDocument();
 
  113        set_error_handler(
'staticxmlerror');
 
  114        $old = ini_set(
'html_errors', 
false);
 
  117            $this->myDOMDocument = 
$source;
 
  129        ini_set(
'html_errors', $old);
 
  130        restore_error_handler();
 
  133            $this->error_arr = 
staticxmlerror(
null, 
null, 
null, 
null, 
null, 
true);
 
  134            foreach ($this->error_arr as $error) {
 
  135                $error = str_replace(
"DOMDocument::loadXML():", 
"", $error);
 
  136                $this->
error .= $error . 
"<br />";
 
  148        unset($this->myDOMDocument);
 
  160        $str = $this->myDOMDocument->saveXML($node->myDOMNode);
 
  167        $ok = $this->myDOMDocument->validate();
 
  170            $error = array(array(
"0", 
"Unknown Error"));
 
  172            if (function_exists(
"libxml_get_last_error")) {
 
  173                $err = libxml_get_last_error();
 
  175                if (is_object($err)) {
 
  176                    $error = array(array($err->code, $err->message));
 
  185        $myAttr = $this->myDOMDocument->createAttribute(
$name);
 
  186        $myAttr->value = $value;
 
  208        return new php4DOMNode($this->myDOMDocument->createTextNode($content));
 
  218        return $this->myDOMDocument->save(
$filename);
 
  223        $r = $this->myDOMDocument->saveXML();
 
  229        $myDOMNodeList = $this->myDOMDocument->getElementsByTagName(
$name);
 
  232        while ($node = $myDOMNodeList->item(
$i)) {
 
  242        return $this->myDOMDocument->saveHTML();
 
  253        return $this->myDOMNode->getAttribute(
$name);
 
  263        $myDOMNodeList = $this->myDOMNode->getElementsByTagName(
$name);
 
  266        while ($node = $myDOMNodeList->item(
$i)) {
 
  276        return $this->myDOMNode->hasAttribute(
$name);
 
  281        return $this->myDOMNode->removeAttribute(
$name);
 
  286        return $this->myDOMNode->setAttribute(
$name, $value);
 
  291        return $this->myDOMNode->tagName;
 
  304        $text_node = 
new DOMText();
 
  305        $text_node->appendData(
$text);
 
  306        if (is_object($this->myDOMNode->firstChild)) {
 
  307            $this->myDOMNode->replaceChild($text_node, $this->myDOMNode->firstChild);
 
  309            $this->myDOMNode->appendChild($text_node);
 
  316        $text_node = $this->myDOMNode->firstChild;
 
  318        if (is_object($text_node)) {
 
  319            return $text_node->textContent;
 
  328        parent::unlink_node($aDomNode);
 
  341        $this->myDOMNode = $aDomNode;
 
  349        $doc = $this->myDOMNode->ownerDocument;
 
  351        $newnode->myDOMNode = $doc->importNode($newnode->myDOMNode, 
true);
 
  353        return new php4DOMElement($this->myDOMNode->appendChild($newnode->myDOMNode));
 
  362        return $this->
set_content($newnode->myDOMNode->textContent);
 
  367        return new php4DOMElement($this->myDOMNode->parentNode->appendChild($newnode->myDOMNode));
 
  373        $myDOMNodeList = $this->myDOMNode->attributes;
 
  376        if (is_object($myDOMNodeList)) {
 
  377            while ($node = $myDOMNodeList->item(
$i)) {
 
  388        $myDOMNodeList = $this->myDOMNode->childNodes;
 
  391        while ($node = $myDOMNodeList->item(
$i)) {
 
  409        if (!is_object($aDomNode)) {
 
  414        $parent = $aDomNode->myDOMNode->parentNode;
 
  415        if (is_object($parent)) {
 
  416            $parent->removeChild($aDomNode->myDOMNode);
 
  432        return $this->myDOMNode->textContent;
 
  437        return $this->myDOMNode->hasAttributes();
 
  442        return $this->myDOMNode->hasChildNodes();
 
  449        $doc = $this->myDOMNode->ownerDocument;
 
  450        $newnode->myDOMNode = $doc->importNode($newnode->myDOMNode, 
true);
 
  453        $mynewnode = $newnode->myDOMNode;
 
  454        $myrefnode = $refnode->myDOMNode;
 
  456            $domel = $mydomnode->insertBefore($mynewnode, $myrefnode);
 
  457        } 
catch (DOMException $exception) {
 
  459            $mydomnode = $this->myDOMNode->parentNode;
 
  460            $domel = $mydomnode->insertBefore($mynewnode, $myrefnode);
 
  469        $last = $this->myDOMNode->lastChild;
 
  471        if (is_object($last)) {
 
  481        $next = $this->myDOMNode->nextSibling;
 
  483        if (is_object($next)) {
 
  493            return $this->myDOMNode->localName;
 
  495            return $this->myDOMNode->nodeName;
 
  501        return $this->myDOMNode->nodeType;
 
  506        return $this->myDOMNode->nodeValue;
 
  512        $parent = $this->myDOMNode->parentNode;
 
  514        if (is_object($parent)) {
 
  524        $prev = $this->myDOMNode->previousSibling;
 
  526        if (is_object($prev)) {
 
  535        return new php4DOMElement($this->myDOMNode->removeChild($oldchild->myDOMNode));
 
  540        return new php4DOMElement($this->myDOMNode->replaceChild($oldchild->myDOMNode, $newnode->myDOMNode));
 
  545        $this->myDOMNode->textContent = 
$text;
 
  546        return $this->myDOMNode->textContent;
 
  557        $this->myDOMNodelist = $aDOMNodelist;
 
  558        $this->nodeset = array();
 
  560        while ($node = $this->myDOMNodelist->item(
$i)) {
 
  579        $this->myDOMXPath = 
new DOMXPath($dom_document->myDOMDocument);
 
  589        return $this->myDOMXPath->registerNamespace($prefix, $namespaceURI);
 
An exception for terminatinating execution or to throw for unit testing.
error($a_errmsg)
set error message @access public
__construct($aDOMCDATASection)
create_cdata_section($content)
get_elements_by_tagname($name)
dump_mem($format=false, $encoding=false)
create_text_node($content)
create_attribute($name, $value)
dump_file($filename, $compressionmode=false, $format=false)
__construct($source, $file=true, $a_mode=0)
get_elements_by_tagname($name)
set_attribute($name, $value)
node_name($a_local=false)
replace_child($oldnode, $newnode)
insert_before($newnode, $refnode)
unlink_node($aDomNode="")
__construct($aDOMNodelist)
__construct($dom_document)
xpath_register_ns($prefix, $namespaceURI)
xpath_eval($xpath_context, $eval_str, $contextnode=null)
staticxmlerror($errno, $errstr, $errfile, $errline, $errcontext, $ret=false)
domxml_open_file($filename)
domxml_open_mem($str, $mode=0, &$error=null)
xpath_new_context($dom_document)
if(function_exists( 'posix_getuid') &&posix_getuid()===0) if(!array_key_exists('t', $options)) $tag