Android decoding html in xml file

后端 未结 3 424
离开以前
离开以前 2020-12-22 03:54

In my software im receiving a xml file that is containing some HTML entities like & amp; or whatever. Im successfull decoding the xml but not the HTML entities. The stri

3条回答
  •  我在风中等你
    2020-12-22 04:09

    I think it iss because it detect "'" apostrophe as a final of string. I've founded a solution.

    String stringDatosEntrada = new Scanner(urlConnection.getInputStream()).useDelimiter("\\A").next().replaceAll("'","\'").replaceAll("'","\'");
    
    InputStream is = new ByteArrayInputStream(stringDatosEntrada.getBytes());
    Document dom = builder.parse(inputStream)
    

提交回复
热议问题