Bug #74494 [Opn->Nab]: DOMDocument::saveXML() LIBXML_NOEMPTYTAG option is ignored
Edit report at https://bugs.php.net/bug.php?id=74494&edit=1
ID: 74494
Updated by: requinix@php.net
Reported by: mfburdett at gmail dot com
Summary: DOMDocument::saveXML() LIBXML_NOEMPTYTAG option is
ignored
-Status: Open
+Status: Not a bug
Type: Bug
Package: DOM XML related
Operating System: FreeBSD
PHP Version: 7.1.4
Block user comment: N
Private report: N
New Comment:
The "libxml Version" reported is what PHP was compiled against, not what it is currently
running with. In fact the phpinfo for ext/libxml calls the same value the "libXML Compiled
Version".
Previous Comments:
------------------------------------------------------------------------
[2017-04-25 22:10:46] mfburdett at gmail dot com
I resolved this issue by purging old libraries in /usr/local/lib/compat/pkg (libraries are
automatically moved here when packages are uninstalled) and forcibly recompiling and reinstalling
all dependencies: portupgrade -fR textproc/php71-dom www/mod_php71
I didn't try to debug, but perhaps an old version of libxml was used despite PHP reporting
libxml 2.9.4?
I think this bug could be closed again since it is resolvable, but hope this report is useful to
someone else who runs into this obscure issue...
------------------------------------------------------------------------
[2017-04-25 20:57:57] requinix@php.net
I haven't found anything to suggest why yours is working differently. I'm still pretty
sure this is not a bug with PHP but I don't know enough to tell you what to test next (besides
maybe a build straight from the libxml2 sources without FreeBSD's patches?) so I'll move
this back to Open.
------------------------------------------------------------------------
[2017-04-25 19:02:42] mfburdett at gmail dot com
phpinfo reports libxml 2.9.4
------------------------------------------------------------------------
[2017-04-25 07:25:32] requinix@php.net
Looks fine to me. https://3v4l.org/pOKD9
What libxml do you have?
------------------------------------------------------------------------
[2017-04-25 00:03:53] mfburdett at gmail dot com
I can also reproduce this bug with an XML document:
<?php
$dom = new \DOMDocument();
$dom->loadXML('<root><node/></root>');
$node = $dom->getElementsByTagName('node')->item(0);
echo $dom->saveXML($node, LIBXML_NOEMPTYTAG);
Expected result: <node></node>
Actual result: <node/>
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=74494
--
Edit this bug report at https://bugs.php.net/bug.php?id=74494&edit=1
Thread (8 messages)