I am trying to convert an HTML string to an XHTML string using JTidy to then parse with XMLWorkerHelper. How do I get the output from Tidy in String instead of Document please?
My code is:
Tidy tidy = new Tidy();
tidy.setXHTML(true);
tidy.setQuiet(true);
tidy.setShowWarnings(false);
org.w3c.dom.Document ppout = tidy.parseDOM(new ByteArrayInputStream(activityDtl.getPPDescription().toString().getBytes()), null);
System.out.println("ppout: " + ppout);
p6.add(new Chunk("Description: ", smallBold));
ElementList list1 = XMLWorkerHelper.parseToElementList(ppout, null);
for (Element element : list1) {
p6.add(element);
preface6.add(p6);
}