Bug #47137 [Com]: LIBXML_NOXMLDECL is not working anymore

2010-05-27 Thread jpatokal at iki dot fi
Edit report at http://bugs.php.net/bug.php?id=47137&edit=1

 ID:   47137
 Comment by:   jpatokal at iki dot fi
 Reported by:  romain dot lalaut at laposte dot net
 Summary:  LIBXML_NOXMLDECL is not working anymore
 Status:   Bogus
 Type: Bug
 Package:  XML related
 Operating System: Linux
 PHP Version:  5.3.0alpha3

 New Comment:

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.


Previous Comments:

[2009-02-03 14:45:31] rricha...@php.net

That is a save option which hasn't yet been implemented so has never 

worked


[2009-01-17 13:58:07] 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:
---
';



$doc = new DOMDocument();

$doc->loadXml($xml, LIBXML_NOXMLDECL);



echo $doc->saveXML();

Expected result:



Actual result:
--









-- 
Edit this bug report at http://bugs.php.net/bug.php?id=47137&edit=1


[PHP-BUG] Bug #51641 [NEW]: Adding namespace with addAttribute() adds spurious xmlns:xmlns attribute

2010-04-22 Thread jpatokal at iki dot fi
From: 
Operating system: All
PHP version:  5.2.13
Package:  SimpleXML related
Bug Type: Bug
Bug description:Adding namespace with addAttribute() adds spurious xmlns:xmlns 
attribute

Description:

If you add a new namespace to a document root with addAttribute(), the
function incorrectly also tries to add a namespace for the new namespace,
resulting in a spurious "xmlns:xmlns" attribute.



Add attribute called "foo:bar"

xmlns:foo="namespace-url" foo:bar="value" <-- correct



Add attribute called "xmlns:bar"

xmlns:xmlns="namespace-url" xmlns:bar="namespace-url" <-- incorrect



A special case is thus needed to ensure that, if the attribute name starts
with "xmlns:", a namespace is not added for it:

xmlns:bar="namespace-url" <-- correct



Alternatively, a new function for adding namespaces to a document?



Test script:
---
');

$xml->addAttribute('xmlns:ooow', 'http://openoffice.org/2004/writer',
'http://openoffice.org/2004/writer');

echo $xml->asXML();

?>





Expected result:



http://openoffice.org/2004/writer"/>



Actual result:
--


http://openoffice.org/2004/writer";
xmlns:ooow="http://openoffice.org/2004/writer"/>



-- 
Edit bug report at http://bugs.php.net/bug.php?id=51641&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=51641&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=51641&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=51641&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=51641&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=51641&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=51641&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=51641&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=51641&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=51641&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=51641&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=51641&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=51641&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=51641&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=51641&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=51641&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=51641&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=51641&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=51641&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=51641&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=51641&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=51641&r=mysqlcfg