#43221 [Opn->Asn]: SimpleXML cannot handle multiple attribute namespaces

From: Date: Mon, 12 Nov 2007 09:55:18 +0000
Subject: #43221 [Opn->Asn]: SimpleXML cannot handle multiple attribute namespaces
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-119500@lists.php.net to get a copy of this message
ID: 43221 Updated by: tony2001@php.net Reported By: jevon at jevon dot org -Status: Open +Status: Assigned Bug Type: SimpleXML related Operating System: Windows XP PHP Version: 5.2.4 -Assigned To: +Assigned To: rrichards New Comment: Rob, could you take a look at it plz? Previous Comments: ------------------------------------------------------------------------ [2007-11-09 02:48:17] jevon at jevon dot org 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 this bug report at http://bugs.php.net/?id=43221&edit=1

« previous php.bugs (#119500) next »