php - SimpleXML Parse Errors due to line breaks -
this part of xml causing issue.
<joburlparameter>?jobid=59077373</joburlparameter><jobclientref erence>
this happens random elements through out xml causes following parse error when try load file using simplexml_load_file.
warning: simplexml_load_file(): parser error : expected '>'
i'm newbie there way line breaks between elements removed?
load file string, run string through str_replace()
, use simplexml_load_string()
something
$xml=file_get_contents('path/to/file.xml'); $xml=str_replace("\n",'',$xml); $simple=simplexml_load_string($xml);
Comments
Post a Comment