Prado\Xml\TXmlDocument::buildElement PHP Méthode

buildElement() protected méthode

Recursively converts DOM XML nodes into TXmlElement
protected buildElement ( $node ) : TXmlElement
Résultat TXmlElement the converted TXmlElement
    protected function buildElement($node)
    {
        $element = new TXmlElement($node->tagName);
        $element->setValue($node->nodeValue);
        foreach ($node->attributes as $name => $attr) {
            $element->getAttributes()->add(($attr->prefix === '' ? '' : $attr->prefix . ':') . $name, $attr->value);
        }
        foreach ($node->childNodes as $child) {
            if ($child instanceof \DOMElement) {
                $element->getElements()->add($this->buildElement($child));
            }
        }
        return $element;
    }