Bug->Req #67387 [Opn]: SimpleXMLElement asXML() and saveXML() ignore LIBXML_NOXMLDECL

From: Date: Wed, 13 Jan 2021 17:31:28 +0000
Subject: Bug->Req #67387 [Opn]: SimpleXMLElement asXML() and saveXML() ignore LIBXML_NOXMLDECL
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231543@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67387&edit=1 ID: 67387 Updated by: cmb@php.net Reported by: anthon at piwik dot org Summary: SimpleXMLElement asXML() and saveXML() ignore LIBXML_NOXMLDECL Status: Open -Type: Bug +Type: Feature/Change Request Package: SimpleXML related Operating System: Linux PHP Version: 5.5.13 Block user comment: N Private report: N New Comment: It has been documented in the meantime that SimpleXMLElement::__construct() only supports options which affect reading of documents. Changing to feature request. Previous Comments: ------------------------------------------------------------------------ [2016-10-14 15:27:11] cmb@php.net Related to bug #50989. ------------------------------------------------------------------------ [2014-06-05 13:57:01] anthon at piwik dot org Description: ------------ asXML() and saveXML() includes the XML declaration contrary to http://ca3.php.net/manual/en/libxml.constants.php LIBXML_NOXMLDECL (integer) Drop the XML declaration when saving a document (#50989 is similar to this bug but was reported for DOMDocument.) Test script: --------------- <?php $xml = new \SimpleXMLElement('<root/>', LIBXML_NOXMLDECL); var_dump($xml->asXML()); Expected result: ---------------- string(8) "<root/> " Actual result: -------------- string(30) "<?xml version="1.0"?> <root/> " ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67387&edit=1

« previous php.bugs (#231543) next »