Horde_Xml_Element::appendChild PHP Method

appendChild() public method

Append a child node to this element.
public appendChild ( Horde_Xml_Element $element )
$element Horde_Xml_Element The element to append.
    public function appendChild(Horde_Xml_Element $element)
    {
        $element->setParent($this);
        $element->_ensureAppended();
        $this->_expireCachedChildren();
    }

Usage Example

Exemplo n.º 1
0
 public function testAppendChild()
 {
     $e = new Horde_Xml_Element('<element />');
     $e2 = new Horde_Xml_Element('<child />');
     $e->appendChild($e2);
     $this->assertEquals('<element><child/></element>', $e->saveXmlFragment());
 }