我正在使用JSOUP(XML档案的java工具),我正在使用以下代码读一部在XML档案中保存的URL。 我的守则如下:
Document d = Jsoup.parse(new File("feed.xml"), null);
Element elementCat = d.getElementsByTag("cat").get(0);
String stringUrl = elementCat.ownText();
System.out.println(stringUrl);
XML投入文件就是这样:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<root>
<cat>http://www.isna.ir/ISNA/FullNews.aspx?SrvID=Event&Lang=P</cat>
</root>
my problem is that the output of program is this: http://www.isna.ir/ISNA/FullNews.aspx?SrvID=Event⟪=P instead of this: http://www.isna.ir/ISNA/FullNews.aspx?SrvID=Event&Lang=P
In other words, it converts "&Lang" to "⟪" automatically. Please pay attention that it is not "⟪", it s just "&Lang" without semicolon. I want to disable encoding or escaping and I want the raw data.
我如何解决这一问题?