ksoap2 xmlPullParserException unterminated entity ref

前端 未结 3 2038
南旧
南旧 2021-01-19 03:38

I have a user email me yesterday that he is having a problem with my application so i started debugging with him and had him sent me the log of the phone and he is getting a

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-19 04:25

    Unterminated entity this error occurs when

    1... Error in response string may be some entity are not closed.

    
         first 
        second             <-----  missing here
    
    

    2... You are getting some xml character in xml file

     like      & { } � ...
    

    you need to replace all & with & amp; see this answer

    ...
    String str = writer.toString();
    str = str.replaceAll("&","&");
    str = str.replaceAll("?","?");
    return str;
    

提交回复
热议问题