Re: [Htmlparser-user] Getting all tags??
Brought to you by:
derrickoswald
From: Thomas Z. <li...@th...> - 2006-04-26 18:20:11
|
Derrick Oswald schrieb: > > You will need to cast it to a tag if possible and use getTagName (): > if (node instanceof Tag) > System.out.println (((Tag)node).getTagName ()); Step by step, I'll get it ... ;-) Now, this code produces no output, Am I still doing something wrong: Parser parser = new Parser("/gb/testfiles/abraham/fabeln/antwort.htm"); Lexer lexer = parser.getLexer(); Node node; String s; while(null != lexer.nextNode()){ node = lexer.nextNode(); if(node instanceof Tag){ System.out.println(((Tag)node).getTagName()); } // if } Greetings and thank you again, I hope that sometimes I'll manage it on my own ... Best regards, Tom |