--TEST-- appendChild() with DocumentType --EXTENSIONS-- dom --FILE-- loadXML(<< ]> XML); $doctype = $original->doctype->cloneNode(); foreach ($doctype->entities as $entity) { echo "Found entity: ", $entity->nodeName, "\n"; } $other = new DOMDocument(); $doctype = $other->importNode($original->doctype); $other->appendChild($doctype); $other->appendChild($doctype); try { $other->appendChild($other->implementation->createDocumentType('doc', '', '')); } catch (DOMException $e) { echo $e->getMessage(), "\n"; } echo $other->saveXml(); ?> --EXPECT-- Found entity: foo A document may only contain one document type ]>