Re: DOMElement::setAttribute() manual example question
| From: | Rob | Date: | Sun, 05 Mar 2006 17:25:46 +0000 |
| Subject: | Re: DOMElement::setAttribute() manual example question | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-231478@lists.php.net to get a copy of this message | ||
Andreas Korthaus wrote:
$node = new DOMElement("root"); is read only, while $node = $doc->createElement("root"); is not? Why?$node = new DOMElement("root"); In this case the element is not associated with a document. In DOM, you really aren't supposed to have a node not associated with any document, but this syntax allows the DOM classes to be extended in PHP. Once the node is associated with a document, you then have full editing capabilities. Rob