note 96128 added to libxml.constants
| From: | zachatwork at gmail dot com | Date: | Wed, 10 Feb 2010 07:30:58 +0000 |
| Subject: | note 96128 added to libxml.constants | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-165820@lists.php.net to get a copy of this message | ||
Note: The LIBXML_NOXMLDECL constant is defined in this library but is not supported by DOMDocument
(yet).
See also: http://bugs.php.net/bug.php?id=47137
<?php
print "PHP_VERSION: ".PHP_VERSION."\n";
print "LIBXML_VERSION: ".LIBXML_VERSION."\n";
print "LIBXML_NOXMLDECL: ".LIBXML_NOXMLDECL."\n";
$dom = new DomDocument();
$dom->loadXML("<foo />");
# This should work but doesn't.
print "DOMDocument doesn't honor LIBXML_NOXMLDECL:\n";
print $dom->saveXML(null,LIBXML_NOXMLDECL);
# This works, and will still work after the above is fixed.
print "Forwards compatible workaround:\n";
$lines = explode("\n", $dom->saveXML(null, LIBXML_NOXMLDECL), 2);
if(!preg_match('/^\<\?xml/', $lines[0]))
print $lines[0];
print $lines[1];
?>
PHP_VERSION: 5.3.1-0.dotdeb.1
LIBXML_VERSION: 20632
LIBXML_NOXMLDECL: 2
DOMDocument doesn't honor LIBXML_NOXMLDECL:
<?xml version="1.0"?>
<foo/>
Forwards compatible workaround:
<foo/>
----
Server IP: 117.55.229.1
Probable Submitter: 203.134.28.230
----
Manual Page -- http://www.php.net/manual/en/libxml.constants.php
Edit -- https://master.php.net/note/edit/96128
Del: integrated -- https://master.php.net/note/delete/96128/integrated
Del: useless -- https://master.php.net/note/delete/96128/useless
Del: bad code -- https://master.php.net/note/delete/96128/bad+code
Del: spam -- https://master.php.net/note/delete/96128/spam
Del: non-english -- https://master.php.net/note/delete/96128/non-english
Del: in docs -- https://master.php.net/note/delete/96128/in+docs
Del: other reasons-- https://master.php.net/note/delete/96128
Reject -- https://master.php.net/note/reject/96128
Search -- https://master.php.net/manage/user-notes.php