ID:               44472
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jsafley at gmu dot edu
-Status:           Open
+Status:           Bogus
 Bug Type:         SimpleXML related
 Operating System: Linux
 PHP Version:      5.2.5
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

SimpleXML works within namespaced scopes. The default being the scope
of 
no and default namespace.


Previous Comments:
------------------------------------------------------------------------

[2008-03-19 00:18:05] [EMAIL PROTECTED]

This output seems expected, see this article:
http://devzone.zend.com/node/view/id/688#Heading3

------------------------------------------------------------------------

[2008-03-18 19:17:55] jsafley at gmu dot edu

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(
      )
    )
  )
)


------------------------------------------------------------------------


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

Reply via email to