Re: [Htmlparser-developer] registerScanners() misbehaving
Brought to you by:
derrickoswald
|
From: <tez...@ya...> - 2003-05-21 10:32:08
|
A patch for HTMLTagTest.java. When you call registerScanners, they don't print the attributes properly. Here in this test case you get <A EN="" =="" HREF="http://www.google.com/webhp?hl"></A> from <a href=http://www.google.com/webhp?hl=en> See how you get the bogus atttributes EN="" and =="" ? This doesn't occur if you don't call registerScanners(); Terry ------- public void testHTMLOutputOfDifficultLinksWithRegisterScanners() throws HTMLParserException { createParser("<a href=http://www.google.com/webhp?hl=en>"); //Straight out of a real world example // assertTrue("Node should be a HTMLLinkTag",node[0] instanceof HTMLLinkTag); parser.registerScanners(); // Register standard scanners (Very Important) String stringTemp=""; for (HTMLEnumeration e = parser.elements(); e.hasMoreNodes();) { HTMLNode newNode = e.nextHTMLNode(); // Get the next HTML Node stringTemp = newNode.toHTML(); System.out.println(stringTemp); } assertEquals("Parsed text should be","<a href=http://www.google.com/webhp?hl=en>",stringTemp); } ===== ------------------------------------------------------------ Terry Alexis Lurie | 'Something witty that doesn't Freelance Computer Engineer | look good with variable United Kingdom | width fonts' - Most nerds __________________________________________________ It's Samaritans' Week. Help Samaritans help others. Call 08709 000032 to give or donate online now at http://www.samaritans.org/support/donations.shtm |