Thread: [Htmlparser-developer] RE: [ htmlparser-Bugs-621137 ] Error in parsing attributes
Brought to you by:
derrickoswald
From: <dha...@or...> - 2002-10-16 07:04:02
Attachments:
BDY.RTF
|
Hi Somik, I fail to understand why u did not get the bug. I ahve downlaoded the latest integration release and tried out. I am receiving the bug. I suggest you try out exactly what I did. In HTMLTextareaTagTest.java there is a string called testHTML as a member variable of the class. I suggest you try chaning <TEXTAREA name=\"Remarks\"> to <TEXTAREA name=\"Remarks\" > in the latter portion of the stirng and run the test condition. It fails. Let me know if u need more help in simulating the condition. Regards, Dhaval Udani Senior Analyst M-Line, QPEG OrbiTech Solutions Ltd. +91-22-8290019 Extn. 1457 -----Original Message----- From: noreply [mailto:no...@so...] Sent: Tuesday, October 15, 2002 12:16 PM To: noreply Cc: noreply Subject: [ htmlparser-Bugs-621137 ] Error in parsing attributes Bugs item #621137, was opened at 2002-10-10 13:29 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=381399&aid=621137&grou p_id=24399 Category: HTMLParameterParser Group: v1.2 Status: Open >Resolution: Works For Me Priority: 5 Submitted By: Dhaval Udani (dhavaludani) >Assigned to: Somik Raha (somik) Summary: Error in parsing attributes Initial Comment: If I have a tag as follows <TEXTAREA name="JohnDoe" ></TEXTAREA> (Note the space before the closing '>' of TEXTAREA tag). On reproduction using toHTML() of TEXTAREA I get the following <TEXTAREA ="" name="JohnDoe"></TEXTAREA> I think this might have been introduced with the fix which took names without values and assigned blank strings to them. It is not very serious since the added code does not create a problem with the browsers but shoudl ideally be avoided. ---------------------------------------------------------------------- >Comment By: Somik Raha (somik) Date: 2002-10-15 15:46 Message: Logged In: YES user_id=187944 Hi Dhaval, I couldnt reproduce this. Can you write a test case which catches this bug ? Below is the code I wrote that works fine : <pre> public void testAttributesReconstruction() throws HTMLParserException { String testHTML = "<TEXTAREA name=\JohnDoe\ ></TEXTAREA>"; StringReader sr = new StringReader (testHTML); HTMLReader reader = new HTMLReader(new BufferedReader (sr),"http://www.google.com/test/index.html"); HTMLParser parser = new HTMLParser (reader,new DefaultHTMLParserFeedback()); HTMLNode [] node = new HTMLNode [10]; parser.registerScanners(); int i = 0; for (HTMLEnumeration e = parser.elements();e.hasMoreNodes();) { node[i++] = e.nextHTMLNode(); } assertEquals("There should have been 2 nodes",2,i); assertTrue("First node should be an HTMLtag",node[0] instanceof HTMLTag); HTMLTag htmlTag = (HTMLTag)node[0]; String expectedHTML = "<TEXTAREA name=\JohnDoe\ >"; assertStringEquals("Expected HTML",expectedHTML,htmlTag.toHTML()); } </pre> Regards, Somik ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=381399&aid=621137&grou p_id=24399 |
From: Somik R. <so...@ya...> - 2002-10-16 10:38:01
|
Hi Dhaval, Thanks for pointing this one out. I've fixed it (superficially), and you shouldnt face a problem, however, the issue in HTMLParameterParser (erroneous holding a blank key ' ') persists. I will collaborate with Kaarle on this. Regards, Somik ----- Original Message ----- From: <dha...@or...> To: <htm...@li...> Sent: Wednesday, October 16, 2002 12:33 PM Subject: [Htmlparser-developer] RE: [ htmlparser-Bugs-621137 ] Error in parsing attributes > Hi Somik, > > I fail to understand why u did not get the bug. I ahve downlaoded the > latest integration release and tried out. I am receiving the bug. I > suggest you try out exactly what I did. > > In HTMLTextareaTagTest.java there is a string called testHTML as a > member variable of the class. I suggest you try chaning <TEXTAREA > name=\"Remarks\"> to <TEXTAREA name=\"Remarks\" > in the latter portion > of the stirng and run the test condition. It fails. > > Let me know if u need more help in simulating the condition. > > Regards, > > Dhaval Udani > Senior Analyst > M-Line, QPEG > OrbiTech Solutions Ltd. > +91-22-8290019 Extn. 1457 > > > > -----Original Message----- > From: noreply [mailto:no...@so...] > Sent: Tuesday, October 15, 2002 12:16 PM > To: noreply > Cc: noreply > Subject: [ htmlparser-Bugs-621137 ] Error in parsing attributes > > > Bugs item #621137, was opened at 2002-10-10 13:29 > You can respond by visiting: > https://sourceforge.net/tracker/?func=detail&atid=381399&aid=621137&grou > p_id=24399 > > Category: HTMLParameterParser > Group: v1.2 > Status: Open > >Resolution: Works For Me > Priority: 5 > Submitted By: Dhaval Udani (dhavaludani) > >Assigned to: Somik Raha (somik) > Summary: Error in parsing attributes > > Initial Comment: > If I have a tag as follows <TEXTAREA name="JohnDoe" > ></TEXTAREA> (Note the space before the closing '>' of > TEXTAREA tag). > > On reproduction using toHTML() of TEXTAREA I get the > following > <TEXTAREA ="" name="JohnDoe"></TEXTAREA> > > I think this might have been introduced with the fix > which took names without values and assigned blank > strings to them. > > It is not very serious since the added code does not > create a problem with the browsers but shoudl ideally > be avoided. > > > ---------------------------------------------------------------------- > > >Comment By: Somik Raha (somik) > Date: 2002-10-15 15:46 > > Message: > Logged In: YES > user_id=187944 > > Hi Dhaval, > I couldnt reproduce this. Can you write a test case which > catches this bug ? > > Below is the code I wrote that works fine : > <pre> > public void testAttributesReconstruction() throws > HTMLParserException { > String testHTML = "<TEXTAREA > name=\JohnDoe\ ></TEXTAREA>"; > StringReader sr = new StringReader > (testHTML); > HTMLReader reader = new > HTMLReader(new BufferedReader > (sr),"http://www.google.com/test/index.html"); > HTMLParser parser = new HTMLParser > (reader,new DefaultHTMLParserFeedback()); > HTMLNode [] node = new HTMLNode > [10]; > parser.registerScanners(); > int i = 0; > for (HTMLEnumeration e = > parser.elements();e.hasMoreNodes();) { > node[i++] = > e.nextHTMLNode(); > } > assertEquals("There should have been > 2 nodes",2,i); > assertTrue("First node should be an > HTMLtag",node[0] instanceof HTMLTag); > HTMLTag htmlTag = (HTMLTag)node[0]; > String expectedHTML = "<TEXTAREA > name=\JohnDoe\ >"; > assertStringEquals("Expected > HTML",expectedHTML,htmlTag.toHTML()); > } > > </pre> > > Regards, > Somik > > ---------------------------------------------------------------------- > > You can respond by visiting: > https://sourceforge.net/tracker/?func=detail&atid=381399&aid=621137&grou > p_id=24399 > > |