[Htmlparser-developer] Table Scanners
Brought to you by:
derrickoswald
From: <dha...@po...> - 2003-05-23 11:59:59
|
Hi, I wrote the following test case public void testUnClosed () throws ParserException { createParser("<TABLE><TR><TR></TR></TABLE>"); parseAndAssertNodeCount(1); =09 assertEquals("Unclosed","<TABLE><TR></TR><TR></TR></TABLE>",node[0].toHt ml()); }=09 I was expecting one node, since <TABLE> would be the main node and <TR> would be its children, but I got 5!!!. Obviously because of that the assert also failed. Since nesting is allowed by default, if there is code as follows : ... <TR> <TD>blah blah</TD> <TR> <TD>blah blah</TD> </TR> .... Then the second <TR> is incorrectly considered as a child of the first <TR> whereas in reality, a closing </TR> was missed out should have been put in. Hence for <TR> nesting should be disallowed through the scanner. Same holds for <TD> tag. I think this is a bug. Dhaval |