php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #63060 Option LIBXML_NOEMPTYTAG is ignored
Submitted: 2012-09-11 09:36 UTC Modified: 2020-03-14 16:56 UTC
Votes:3
Avg. Score:4.0 ± 0.8
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:1 (33.3%)
From: maglor at i dot ua Assigned: cmb (profile)
Status: Closed Package: SimpleXML related
PHP Version: 5.3.16 OS: Windows XP SP3
Private report: No CVE-ID: None
 [2012-09-11 09:36 UTC] 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>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-09-11 12:12 UTC] 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.
 [2020-02-13 17:07 UTC] cmb@php.net
-Status: Open +Status: Verified -Type: Bug +Type: Documentation Problem
 [2020-02-13 17:07 UTC] 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*.
 [2020-03-14 16:56 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=349428
Log: Fix #63060: Option LIBXML_NOEMPTYTAG is ignored
 [2020-03-14 16:56 UTC] cmb@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: cmb
 [2020-03-14 16:56 UTC] cmb@php.net
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.
 [2020-03-14 16:58 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=0694f171134f59786e740860e95b80bad75d56c9
Log: Fix #63060: Option LIBXML_NOEMPTYTAG is ignored
 [2020-03-14 23:00 UTC] mumumu@php.net
Automatic comment from SVN on behalf of mumumu
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=349440
Log: Fix #63060: Option LIBXML_NOEMPTYTAG is ignored
 [2020-03-14 23:05 UTC] phpdocbot@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=95255990ccd74028748e6ce7a55c185da8c2c414
Log: Fix #63060: Option LIBXML_NOEMPTYTAG is ignored
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Aug 14 11:01:25 2020 UTC