Doc #63060 [Ver->Csd]: Option LIBXML_NOEMPTYTAG is ignored
| From: | cmb@php.net | Date: | Sat, 14 Mar 2020 16:56:52 +0000 |
| Subject: | Doc #63060 [Ver->Csd]: Option LIBXML_NOEMPTYTAG is ignored | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-17421@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: Verified
+Status: Closed
Type: Documentation Problem
Package: SimpleXML related
Operating System: Windows XP SP3
PHP Version: 5.3.16
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2020-03-14 16:56:47] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=349428
Log: Fix #63060: Option LIBXML_NOEMPTYTAG is ignored
------------------------------------------------------------------------
[2020-02-13 17:07:21] cmb@php.net
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*.
------------------------------------------------------------------------
[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