Bug #81682 [Com]: DocumentType nodes cannot be cloned nor imported

From: Date: Mon, 28 Nov 2022 08:37:20 +0000
Subject: Bug #81682 [Com]: DocumentType nodes cannot be cloned nor imported
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-242963@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81682&edit=1 ID: 81682 Comment by: ayhenswcnickolas at gmail dot com Reported by: jules dot bernable at gmail dot com Summary: DocumentType nodes cannot be cloned nor imported Status: Open Type: Bug Package: DOM XML related Operating System: irrelevant PHP Version: 8.1.0 Block user comment: N Private report: N New Comment: hello Purchasing multiple devices and gadgets can be very costly. The best option to perform cross-platform testing on different environments is to use emulators and virtualization. You can create own virtual machines with various platforms and configurations combinations to test applications. (https://www.mybkexperience.review)github.com Previous Comments: ------------------------------------------------------------------------ [2022-08-17 05:25:28] prestigecitytownshipsarjapur at gmail dot com prestigecity.gen.in ------------------------------------------------------------------------ [2021-12-01 08:01:54] jules dot bernable at gmail dot com Description: ------------ When trying to clone or import a doctype node, the operation always fail. AFAICT there's nothing in the DOM standard saying this should be the case (see https://dom.spec.whatwg.org/#dom-document-importnode). Test script: --------------- $original = new DOMDocument(); $original->loadHTML('<!DOCTYPE html>'); $docytpe = $original->doctype->cloneNode(); var_dump($doctype); // false $other = new DOMDocument(); $doctype = $other->importNode($original->doctype); var_dump($doctype); // false Expected result: ---------------- The result should be a new DocumentType node with the same name, publicId and systemId and, in the case of importNode, associated with the new document. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=81682&edit=1

« previous php.bugs (#242963) next »