org.xml.sax.SAXParseException: Unexpected token while parsing XML

前端 未结 4 1364
北海茫月
北海茫月 2021-01-13 16:13

Update:- Seems like I have to give the URL which is returning me the xml. Here it is - URL


I am getting SAXParseException when parsing an xml.

4条回答
  •  日久生厌
    2021-01-13 16:49

    The problem was in the encoding. The following answer explains it properly -

    https://stackoverflow.com/a/2869127/1079901

    I just have to call this regex on the response string -

    response = response.replaceAll("[^\\x20-\\x7e]", "");
    

    Thanks to BalusC for such a perfect answer.

提交回复
热议问题