Skip to content

Instantly share code, notes, and snippets.

@abdulvayani
Created April 5, 2011 19:27
Show Gist options
  • Save abdulvayani/904326 to your computer and use it in GitHub Desktop.
Save abdulvayani/904326 to your computer and use it in GitHub Desktop.
printHtml method
private static void printHTML(Node target)
{
if(target.hasBache())
{
int bachaCount = target.getKids().size();
int i;
for(i = 0; i < bachaCount; i++)
{
Node child = target.getKids().get(i);
if(child.isTag())
{
System.out.println("<" + child.getTag() + ">");
printHTML(child);
System.out.println("</" + child.getTag() + ">");
}else{
System.out.println(child.getText());
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment