"Error translating HTML fragment into DRI", t);
}
SAXFilter filter = new SAXFilter(contentHandler, lexicalHandler,
namespaces);
SAXOutputter outputter = new SAXOutputter();
outputter.setContentHandler(filter);
outputter.setLexicalHandler(filter);
Element root = document.getRootElement();
@SuppressWarnings("unchecked")
// This cast is correct
List<Element> children = root.getChildren();
for (Element child : children) {
outputter.output(child);
}
} catch (JDOMException e) {
//If we are here, then a parsing error occurred within the XHTML fragment. We'll just assume
// that this is not supposed to be XHTML and display the fragment as plain text within <dri:p> tags.