Skip to content

Instantly share code, notes, and snippets.

@bilalq
Forked from abdulvayani/sexycode.java
Created April 6, 2011 00:29
Show Gist options
  • Save bilalq/904890 to your computer and use it in GitHub Desktop.
Save bilalq/904890 to your computer and use it in GitHub Desktop.
private static void printHTML(Node target)
{
if(target.hasBache())
{
ArrayList<Node> temp = target.getKids();
for(int i = 0; i < temp.size(); i++)
{
Node child = temp.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