XML to CSV conversion : Does not understand HTML characters and other special characters

南笙酒味 提交于 2019-12-13 09:53:07

问题


I found this code to convert any XML to CSV in java. the code works really great except with some exceptions. here is the code: Convert XML file to CSV in java

My xml contains few special characters and html data. an example of one of the tags from my xml is listed below:

<html-rem-string1>
    <tr>
        <td style="background-color:#f0ebeb;">Feline Rabies Vaccination, 1yr </td>
        <td style="font-weight: bold; color:#cc0000; background-color:#f0ebeb;">6/27/2013
        </td>
    </tr>
</html-rem-string1>

Now whenever I try to convert this, I get unusual results. My understanding is it does not understand HTML tags and special characters (I dont really know the distinction between two sorry).

Does someone know how can I get exact same value in my csv.

Thanks.


回答1:


You should use HTML parser, eg. this one. Also take a look at this question.



来源:https://stackoverflow.com/questions/19434274/xml-to-csv-conversion-does-not-understand-html-characters-and-other-special-ch

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!