From:             jsafley at gmu dot edu
Operating system: Linux
PHP version:      5.2.5
PHP Bug Type:     SimpleXML related
Bug description:  SimpleXMLElement() drops nodes

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 bug report at http://bugs.php.net/?id=44472&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=44472&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=44472&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=44472&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=44472&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=44472&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=44472&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=44472&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=44472&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=44472&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=44472&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=44472&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=44472&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=44472&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=44472&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=44472&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=44472&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=44472&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=44472&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=44472&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=44472&r=mysqlcfg

Reply via email to