我有以下XML feed:
<Description>
<p>Touch, tap, flip, slide! You don't just read Books, you experience it.</p>
</Description>
Run Code Online (Sandbox Code Playgroud)
在这里,我必须显示如下的描述
触摸,点击,翻页,滑动!你不能阅读书籍,你会体验到它.
在这里,我处理了解析器,如:
public static String removeHTML(String htmlString)
{
// Remove HTML tag from java String
String noHTMLString = htmlString.replaceAll("\\<.*?\\>", "");
// Remove Carriage return from java String
noHTMLString = noHTMLString.replaceAll("\r", "<br/>");
noHTMLString = noHTMLString.replaceAll("<([bip])>.*?</\1>", "");
// Remove New line from java string and replace html break
noHTMLString = noHTMLString.replaceAll("\n", " ");
noHTMLString = noHTMLString.replaceAll("\"", """);
noHTMLString = noHTMLString.replaceAll("<(.*?)\\>"," ");//Removes all items in brackets …Run Code Online (Sandbox Code Playgroud)