#50805 [NEW]: simplexml_load_string not finding any data
| From: | okycastro at gmail dot com | Date: | Wed, 20 Jan 2010 15:45:53 +0000 |
| Subject: | #50805 [NEW]: simplexml_load_string not finding any data | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-146821@lists.php.net to get a copy of this message | ||
From: okycastro at gmail dot com
Operating system: windows vista
PHP version: 5.2.12
PHP Bug Type: *XML functions
Bug description: simplexml_load_string not finding any data
Description:
------------
simplexml_load_string not producing the expected results
Reproduce code:
---------------
$xml = <<<XML
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:createBanResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://ws.interfaces.sessions.APILink.amdocs">
<createBanReturn href="#id0" />
</ns1:createBanResponse>
<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:OutCreateBanInfo"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="http://io.datainfo.APILink.amdocs">
<ban xsi:type="xsd:int">688666259</ban>
</multiRef>
</soapenv:Body>
</soapenv:Envelope>
XML;
$root = simplexml_load_string($xml);
var_dump($root); //EMPTY
$result = $root->xpath("ban");//EMPTY
print_r($result);//EMPTY
Expected result:
----------------
I expected some data from the xml. For example xpath should return
688666259. I use simplexml_load_string many time and never have
problems. I never used it with an xml with so many attributes.
Actual result:
--------------
Array ( ) object(SimpleXMLElement)#1 (0) { }
--
Edit bug report at http://bugs.php.net/?id=50805&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=50805&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=50805&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=50805&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=50805&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=50805&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=50805&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=50805&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=50805&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=50805&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=50805&r=support
Expected behavior: http://bugs.php.net/fix.php?id=50805&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=50805&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=50805&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=50805&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=50805&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=50805&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=50805&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=50805&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=50805&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=50805&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=50805&r=mysqlcfg