No DOM_HIERARCHY_REQUEST_ERR

From: Date: Mon, 01 Jul 2013 21:01:43 +0000
Subject: No DOM_HIERARCHY_REQUEST_ERR
Groups: php.qa 
Request: Send a blank email to php-qa+get-66907@lists.php.net to get a copy of this message
Hi I've tried the following code: $dom = new DOMDocument(); $element = $dom->appendChild(new DOMElement('root')); $attr = new DOMAttr('attr', 'attrvalue'); $element->setAttributeNode($attr); $newNode = new DOMCdataSection('root value'); $attr->appendChild($newNode); echo $dom->saveXML(); In the second appenChild method I'm trying to append a Cdata section as a child of an Attribute, which is not allowed. According to the PHP manual it should raised a DOM HIERARCHY_REQUEST error. But although the Cdata section is not added, it doesn't show any error message. I'm a bit confused about the proper behavior of this method in this particular case. Could somebody clarify this point? Thanks Regards Antonio

« previous php.qa (#66907) next »