Bug->Doc #63060 [Opn->Ver]: Option LIBXML_NOEMPTYTAG is ignored

From: Date: Thu, 13 Feb 2020 17:07:21 +0000
Subject: Bug->Doc #63060 [Opn->Ver]: Option LIBXML_NOEMPTYTAG is ignored
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-17296@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=63060&edit=1 ID: 63060 Updated by: cmb@php.net Reported by: maglor at i dot ua Summary: Option LIBXML_NOEMPTYTAG is ignored -Status: Open +Status: Verified -Type: Bug +Type: Documentation Problem Package: SimpleXML related Operating System: Windows XP SP3 PHP Version: 5.3.16 Block user comment: N Private report: N New Comment: The $options parameter of SimpleXMLElement::construct(), simplexml_load_string() and simplexml_load_file() is only relevant for options which affect the *reading* of XML. It is not supposed to apply to *writing*. Previous Comments: ------------------------------------------------------------------------ [2012-09-11 12:12:01] reeze dot xia at gmail dot com Hi maglor, http://php.net/manual/en/libxml.constants.php LIBXML_NOEMPTYTAG (integer) Expand empty tags (e.g. <br/> to <br></br>) Note: This option is currently just available in the DOMDocument::save and DOMDocument::saveXML functions. ------------------------------------------------------------------------ [2012-09-11 09:36:02] maglor at i dot ua Description: ------------ Option LIBXML_NOEMPTYTAG is ignored for SimpleXMLElement::__construct() and simplexml_load_string() Probably, for simplexml_load_file() also. Test script: --------------- <?php $xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><request><packet></packet></request>', LIBXML_NOEMPTYTAG); $xml->saveXML(); Expected result: ---------------- <?xml version="1.0" encoding="utf-8"?> <request><packet></packet></request> Actual result: -------------- <?xml version="1.0" encoding="utf-8"?> <request><packet/></request> ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=63060&edit=1

« previous php.doc.bugs (#17296) next »