simplexml_load_string errors on big files occur on one system but not another

后端 未结 3 493
暗喜
暗喜 2020-12-29 08:15

I\'m dealing with a third party PHP library that I can\'t edit, and it\'s been working fine for almost a year. It uses simplexml_load_string on the response fro

3条回答
  •  暖寄归人
    2020-12-29 08:41

    Your XML is Invalid and should cause an issue in both cases.

    You need to have ONLY ONE ROOT.

    ie. Everything should be inside your tags:

    
    
        ...
    
    

    You have multiple roots in your XML, which will cause an issue :-)

    Try wrapping it all in a root node and see if it works.

    
    
        
        ...
        
        
    
    

    I'm not sure if it would be the difference in libxml, or a different level of error reporting allowing it to work on one and not the other, but that looks like the issue to me.

提交回复
热议问题