Re: [Htmlparser-developer] testStringBeanListener() consistently failing
Brought to you by:
derrickoswald
From: Somik R. <so...@ya...> - 2003-02-09 03:27:58
|
Hi, Here's a testcase that proves there's no bug: public void testTagWithQuotes() throws Exception { String testHtml = "<img src=\"http://g-images.amazon.com/images/G/01/merchants/logos/marshall-fields -logo-20.gif\" width=87 height=20 border=0 alt=\"Marshall Field's\">"; createParser(testHtml); parseAndAssertNodeCount(1); assertType("should be HTMLTag",HTMLTag.class,node[0]); HTMLTag tag = (HTMLTag)node[0]; assertStringEquals("alt","Marshall Field's",tag.getAttribute("ALT")); assertStringEquals( "html", "<IMG BORDER=\"0\" ALT=\"Marshall Field's\" WIDTH=\"87\" SRC=\"http://g-images.amazon.com/images/G/01/merchants/logos/marshall-fields -logo-20.gif\" HEIGHT=\"20\">", tag.toHTML() ); } This test is now in org.htmlparser.tests.parserHelperTests.TagParserTest Regards, Somik ----- Original Message ----- From: "Somik Raha" <so...@ya...> To: <htm...@li...> Sent: Saturday, February 08, 2003 6:44 PM Subject: Re: [Htmlparser-developer] testStringBeanListener() consistently failing > Derrick Oswald wrote: > > ERROR: HTMLReader.readElement() : Error occurred while trying to > > decipher the tag using scanners > > at Line 686 : null > > > > ...and then it really starts to have problems. It seems the "xxxxxx's" > > pattern causes grief as it reads the > in what it thinks is a single > > quoted string and 'fixes' it. > > I doubt that this is the problem.. It was bcos of the TableScanner, Div > Scanner, and Span scanners. I had taken a gamble by putting them in the > current set of registered scanners - there's a lot of dirty html out there > that don't close the div's or span's or table's. Instead of fixing this > issue by adding more code, I want to try refactoring this logic from the > link and form scanners and reuse it. > > For now, the above mentioned three scanners are not registered by default > (the page gets parsed just fine after that). > > Regards, > Somik > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! > http://www.vasoftware.com > _______________________________________________ > Htmlparser-developer mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-developer |