src/XmlUtil.php
public static function addTextNode(\DOMNode $rootNode, $text, $escapeChars = false)
    {
        if (!empty($text) || is_numeric($text)) {
            $owner = XmlUtil::getOwnerDocument($rootNode);
            if ($escapeChars) {
                $nodeworkingText = $owner->createCDATASection($text);
            } else {
                $nodeworkingText = $owner->createTextNode($text);
            }
            $rootNode->appendChild($nodeworkingText);
        }
    }
public static function addTextNode(\DOMNode $rootNode, $text, $escapeChars = false)
    {
        if (!empty($text) || is_numeric($text)) {
            $owner = XmlUtil::getOwnerDocument($rootNode);
            if ($escapeChars) {
                $nodeworkingText = $owner->createCDATASection($text);
            } else {
                $nodeworkingText = $owner->createTextNode($text);
            }
            $rootNode->appendChild($nodeworkingText);
        }
    }
public static function addTextNode ( \ DOMNode $ rootNode , $ text , $ escapeChars = false ) { if ( ! empty ( $ text ) || is_numeric ( $ text ) ) { $ owner = XmlUtil :: getOwnerDocument ( $ rootNode ) ; if ( $ escapeChars ) { $ nodeworkingText = $ owner -> createCDATASection ( $ text ) ; } else { $ nodeworkingText = $ owner -> createTextNode ( $ text ) ; } $ rootNode -> appendChild ( $ nodeworkingText ) ; } }
Add text to node

@param \DOMNode $rootNode Parent node
@param string $text Text to add String
@param bool $escapeChars (True create CData instead Text node)
@throws \ByJG\Util\Exception\XmlUtilException
Add text to node