Monday, August 5, 2019

When reading emails from JAVA application, it returns content body in xhtml format. Following code can be used to convert xhtml tages to html.

org.jsoup.nodes.Document document = Jsoup.parseBodyFragment(xhtml);
document.outputSettings().escapeMode(Entities.EscapeMode.xhtml);
String str = document.body().html();