Re: [Htmlparser-user] does someone have a simple example of printing out all nodes of a document
Brought to you by:
derrickoswald
From: Derrick O. <der...@ro...> - 2007-11-24 00:23:57
|
Printing out the top level node generates the entire html again. NodeLists also understand toHtml(). So for a parse like, NodeList list = parser.parse (null); the entire page is printed out with: System.out.println (list.toHtml ()); or for (int i = 0; i < list.size(); i++) System.out.println (list.elementAt(i).toHtml ()); You should look at the toHtml() method of CompositeTag if you don't want it to print the nested tags. ----- Original Message ---- From: Randy Paries <rtp...@gm...> To: htm...@li... Sent: Friday, November 23, 2007 3:55:06 PM Subject: [Htmlparser-user] does someone have a simple example of printing out all nodes of a document hello, this should not be as hard as i am making this, but i have a brain lock. I need a simple function to parse a html file and print out each of its nodes i am espesiailly having problems with nested nodes. Like tables within divs within divs. it needs to prints everything so, i could take the output and display the same html page. but it needs to go to the level where there are no children. I hope this make sense. thanks for any help someone can give me randy ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Htmlparser-user mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/htmlparser-user |