[Htmlparser-user] Parsing Partial HTML text
Brought to you by:
derrickoswald
|
From: <mic...@no...> - 2007-09-26 14:31:01
|
I am having trouble parsing html tagged text. It seems that I can retrieve
a node but that element does not have the child nodes as expected.
String table =
"<tbody>\n" +
"<tr>\n" +
"<td><span>brain_normal_GSM80627</span></td>\n" +
"<td><span>normal</span></td>\n" +
"<td><span>cerebral cortex</span></td>\n" +
"<td><span>brain</span></td>\n" +
"</tr>\n" +
"</tbody>\n";
Parser parser = new Parser(new Lexer(table));
try {
Node tBodyNode = parser.extractAllNodesThatMatch(new
TagNameFilter("tbody")).elementAt(0);
System.out.println(tBodyNode.getChildren()); // Prints null
<---------------
} catch (ParserException e) {
e.printStackTrace(); //To change body of catch statement use
File | Settings | File Templates.
}
Does HTML Parser not handle text input or partial html files well?
_________________________
CONFIDENTIALITY NOTICE
The information contained in this e-mail message is intended only for the
exclusive use of the individual or entity named above and may contain
information that is privileged, confidential or exempt from disclosure
under applicable law. If the reader of this message is not the intended
recipient, or the employee or agent responsible for delivery of the
message to the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication is strictly
prohibited. If you have received this communication in error, please
notify the sender immediately by e-mail and delete the material from any
computer. Thank you.
|