Public Member Functions

php4DOMElement Class Reference

php4DomElement More...

Inheritance diagram for php4DOMElement:
Collaboration diagram for php4DOMElement:

Public Member Functions

 get_attribute ($name)
 get_elements_by_tagname ($name)
 has_attribute ($name)
 remove_attribute ($name)
 set_attribute ($name, $value)
 tagname ()
 set_content ($text)
 get_content ()
 unlink ($aDomNode)

Detailed Description

php4DomElement

Definition at line 202 of file inc.xml5compliance.php.


Member Function Documentation

php4DOMElement::get_attribute ( name  ) 

Definition at line 204 of file inc.xml5compliance.php.

        {
                return $this->myDOMNode->getAttribute($name);
        }

php4DOMElement::get_content (  ) 

Reimplemented from php4DOMNode.

Definition at line 266 of file inc.xml5compliance.php.

        {
                $text_node =& $this->myDOMNode->firstChild;

                if (is_object($text_node))
                {
                        return $text_node->textContent;
                }
                else
                {
                        return "";
                }
        }

php4DOMElement::get_elements_by_tagname ( name  ) 

Definition at line 209 of file inc.xml5compliance.php.

        {
                $myDOMNodeList=$this->myDOMNode->getElementsByTagName($name);
                $nodeSet=array();
                $i=0;
                while ($node=$myDOMNodeList->item($i))
                {
                        $nodeSet[]=new php4DOMElement($node);
                        $i++;
                }

                return $nodeSet;
        }

php4DOMElement::has_attribute ( name  ) 

Definition at line 223 of file inc.xml5compliance.php.

        {
                return $this->myDOMNode->hasAttribute($name);
        }

php4DOMElement::remove_attribute ( name  ) 

Definition at line 228 of file inc.xml5compliance.php.

        {
                return $this->myDOMNode->removeAttribute($name);
        }

php4DOMElement::set_attribute ( name,
value 
)

Definition at line 233 of file inc.xml5compliance.php.

        {
                return $this->myDOMNode->setAttribute($name,$value);
        }

php4DOMElement::set_content ( text  ) 

Reimplemented from php4DOMNode.

Definition at line 244 of file inc.xml5compliance.php.

        {
                // the following replace has been added to conform with PHP4.
                // A set_content("&") brought a get_content() = "&" there,
                // whereas PHP5 gives a get_content() = "&"
                $text = str_replace("&lt;", "<", $text);
                $text = str_replace("&gt;", ">", $text);
                $text = str_replace("&amp;", "&", $text);
                
                $text_node =& new DOMText();
                $text_node->appendData($text);
                if (is_object($this->myDOMNode->firstChild))
                {
                        $this->myDOMNode->replaceChild($text_node, $this->myDOMNode->firstChild);
                }
                else
                {
                        $this->myDOMNode->appendChild($text_node);
                }
        }

php4DOMElement::tagname (  ) 

Definition at line 238 of file inc.xml5compliance.php.

        {
                return $this->myDOMNode->tagName;
        }

php4DOMElement::unlink ( aDomNode  ) 

Definition at line 281 of file inc.xml5compliance.php.

References php4DOMNode::unlink_node().

        {
                parent::unlink_node($aDomNode);
        }

Here is the call graph for this function:


The documentation for this class was generated from the following file: