Sorry I\'m a Java/XML newbie - and can\'t seem to figure this one out. It seems it\'s possible to convert a Document object to a string. However, I want to convert a Node ob
This is way to convert Node to html
public static String getInnerHTML(Node node) throws TransformerConfigurationException, TransformerException
{
StringWriter sw = new StringWriter();
Result result = new StreamResult(sw);
TransformerFactory factory = TransformerFactory.newInstance();
Transformer proc = factory.newTransformer();
proc.setOutputProperty(OutputKeys.METHOD, "html");
for (int i = 0; i < node.getChildNodes().getLength(); i++)
{
proc.transform(new DOMSource(node.getChildNodes().item(i)), result);
}
return sw.toString();
}