FluentDOM\Transformer\Namespaces\Optimize::addNode PHP Méthode

addNode() private méthode

Add a node to the target element, just copies any child nodes except elements. Element nodes are recreated with mapped/optimized namespaces.
private addNode ( DOMNode $target, DOMNode $source )
$target DOMNode
$source DOMNode
    private function addNode(\DOMNode $target, \DOMNode $source)
    {
        if ($source instanceof \DOMElement) {
            $this->addElement($target, $source);
        } else {
            $document = $target instanceof \DOMDocument ? $target : $target->ownerDocument;
            $target->appendChild($document->importNode($source));
        }
    }