Bugs php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login

go to bug id or search bugs for

Bug #47137 LIBXML_NOXMLDECL is not working anymore
Submitted: 2009年01月17日 13:58 UTC Modified: 2009年02月03日 14:45 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: romain dot lalaut at laposte dot net Assigned:
Status: Not a bug Package: XML related
PHP Version: 5.3.0alpha3 OS: Linux
Private report: No CVE-ID: None
[2009年01月17日 13:58 UTC] romain dot lalaut at laposte dot net
Description:
------------
It seems that saving a DOMDocument which is loaded with LIBXML_NOXMLDECL doesn't avoid to get the xml declaration.
It is a big problem to produce a xhtml document for internet because IE6 is not dead yet.
Tested with libxml2 2.6.32 and 2.7.2
Reproduce code:
---------------
<?php
$xml = '<myxml/>';
$doc = new DOMDocument();
$doc->loadXml($xml, LIBXML_NOXMLDECL);
echo $doc->saveXML();
Expected result:
----------------
<myxml/>
Actual result:
--------------
<?xml version="1.0"?>
<myxml/>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
[2009年02月03日 14:45 UTC] rrichards@php.net
That is a save option which hasn't yet been implemented so has never 
worked
[2010年05月28日 03:45 UTC] jpatokal at iki dot fi
This is not "bogus" at all. See http://www.php.net/manual/en/libxml.constants.php:
 LIBXML_NOXMLDECL ( integer )
 Drop the XML declaration when saving a document 
From that, I'd expect saveXML to drop the XML declaration as promised, but it does not, so it's broken. See also http://bugs.php.net/bug.php?id=50989.
[2011年08月11日 10:31 UTC] suit at rebell dot at
It is stoll not fixed and its very annoying, if you want to create XML documents without declaration. Bug #50989 works for me, but its still no satisfying solution.
Fix this either in PHP or at least in the Documentation.
[2013年09月23日 11:10 UTC] joscha at feth dot com
Is there any update on this issue?
[2013年12月12日 15:38 UTC] avillalbacasas at gmail dot com
Is there any update about this issue? If it doesn't work, and it will not work, please update the documentation since that it is a fake right now.
PHP Copyright © 2001-2025 The PHP Group
All rights reserved. Last updated: Mon Dec 15 02:00:01 2025 UTC

AltStyle によって変換されたページ (->オリジナル) /