#43221 [NEW]: SimpleXML cannot handle multiple attribute namespaces

From: Date: Fri, 09 Nov 2007 02:48:17 +0000
Subject: #43221 [NEW]: SimpleXML cannot handle multiple attribute namespaces
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-119380@lists.php.net to get a copy of this message
From: jevon at jevon dot org Operating system: Windows XP PHP version: 5.2.4 PHP Bug Type: SimpleXML related Bug description: SimpleXML cannot handle multiple attribute namespaces Description: ------------ Namespace support in SimpleXML is all screwy. In particular, you cannot add two differently-namespaced attributes to a SimpleXML node; the first one is lost. Reproduce code: --------------- $xml = new SimpleXMLElement('<root />'); $n = $xml->addChild("node", "value"); // still fails even if we set a NS here $n->addAttribute("a", "b"); // still fails even if we set a different NS here $n->addAttribute("c", "d", "http://bar.com"); print_r($xml->asXml()); Expected result: ---------------- <root xmlns:a="http://bar.com"><node a="b" a:c="d">value</node></root> Actual result: -------------- <root><node xmlns="http://bar.com" a="b" c="d">value</node></root> -- Edit bug report at http://bugs.php.net/?id=43221&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43221&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43221&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43221&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43221&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=43221&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=43221&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=43221&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=43221&r=needscript Try newer version: http://bugs.php.net/fix.php?id=43221&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=43221&r=support Expected behavior: http://bugs.php.net/fix.php?id=43221&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=43221&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=43221&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=43221&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43221&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=43221&r=dst IIS Stability: http://bugs.php.net/fix.php?id=43221&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=43221&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=43221&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=43221&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=43221&r=mysqlcfg

« previous php.bugs (#119380) next »