simplexml_load_string returns blank node

romocop

New Member
I am using \[code\]simplexml_load_string()\[/code\] to parse xml string. It reads the input correctly, but doesn't return any data only blank nodes.My xml data is:\[code\]<?xml version="1.0" encoding="UTF-8" standalone="yes"?><leads> <auth> <username>user</username> <password>user</password> </auth></leads>\[/code\]And the function is:\[code\]$xmlObj = simplexml_load_string($xml); if ($xmlObj) { echo "Failed loading XML\n"; foreach(libxml_get_errors() as $error) { echo "\t", $error->message; } } else{ print_r($xmlObj); }\[/code\]When I am trying to print the result I am getting a blank nodes like\[code\]<auth> </username> </password> </auth>\[/code\]
 
Back
Top