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

From: Date: Fri, 14 Oct 2016 15:27:12 +0000
Subject: Bug #67387 [Opn]: SimpleXMLElement asXML() and saveXML() ignore LIBXML_NOXMLDECL
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204776@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 Package: SimpleXML related Operating System: Linux PHP Version: 5.5.13 Block user comment: N Private report: N New Comment: Related to bug #50989. Previous Comments: ------------------------------------------------------------------------ [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 (#204776) next »