I'm using the SAX xml parser to parse some xml data which contains newlines. When using Attributes#getValue, the newline data is lost. How can keep the newlines?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
you can use this code when getting the String to parse:
public void characters(char ch[], int start, int length) {
for(int i=start; i<length; i++)
if(!Character.isISOControl(ch[i]))
content.append(ch[i]);
}
回答2:
The solution was to use 

instead of \n