|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-03-19 00:18 UTC] felipe@php.net
[2008-03-21 10:58 UTC] rrichards@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 06:00:01 2025 UTC |
Description: ------------ new SimpleXMLElement() drops namespaced nodes. Reproduce code: --------------- $xmlstr = <<<XML <OAI-PMH> <ListRecords> <record> <metadata> <oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/"> <dc:title>A comparative study</dc:title> <dc:creator>Talabi, A.O.</dc:creator> <dc:publisher>African Journal</dc:publisher> <dc:date>1970-01-01</dc:date> </oai_dc:dc> </metadata> </record> </ListRecords> </OAI-PMH> XML; $xml = new SimpleXMLElement($xmlstr); print_r($xml); Expected result: ---------------- SimpleXMLElement Object ( [ListRecords] => SimpleXMLElement Object ( [record] => SimpleXMLElement Object ( [metadata] => SimpleXMLElement Object( [dc] => SimpleXMLElement Object ( [title] => SimpleXMLElement Object ( A comparative study ) [creator] => SimpleXMLElement Object ( Talabi, A.O. ) [publisher] => SimpleXMLElement Object ( African Journal ) [date] => SimpleXMLElement Object ( 1970-01-01 ) ) ) ) ) ) Actual result: -------------- SimpleXMLElement Object ( [ListRecords] => SimpleXMLElement Object ( [record] => SimpleXMLElement Object ( [metadata] => SimpleXMLElement Object( ) ) ) )