Req #67507 [Opn->Wfx]: Attribute namespace retrieval

From: Date: Tue, 24 Jun 2014 17:31:58 +0000
Subject: Req #67507 [Opn->Wfx]: Attribute namespace retrieval
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186326@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67507&edit=1 ID: 67507 Updated by: requinix@php.net Reported by: akos dot toth at cheppers dot com Summary: Attribute namespace retrieval -Status: Open +Status: Wont fix Type: Feature/Change Request Package: SimpleXML related Operating System: Ubuntu 14.04 LTS PHP Version: 5.5.13 Block user comment: N Private report: N New Comment: There is documentation for a reason. http://www.php.net/manual/en/simplexmlelement.attributes.php print('X' . $object->base->attributes('xml', true)->lang); Previous Comments: ------------------------------------------------------------------------ [2014-06-24 15:54:17] akos dot toth at cheppers dot com Description: ------------ Why? There is literally no reason for the case highlighted in the test script to not produce the expected output. This is supposed to be simple xml, not overly complicated and utterly useless for even parsing (not to mention creating) xml structures. Test script: --------------- $object = simplexml_load_string('<root><base xml:lang="en" /></root>'); print('U' . $object->base->attributes('http://www.w3.org/XML/1998/namespace')->lang); print('X' . $object->base->attributes('xml')->lang); Expected result: ---------------- Prints "UenXen" (both methods work for retrieving the attribute). Actual result: -------------- Prints "UenX" (simply making the referenced namespace 'xml' does not work, instead I have to add that goddamn bloated URL). ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67507&edit=1

« previous php.bugs (#186326) next »