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

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -