Re: [Htmlparser-developer] HTMLTag patch
Brought to you by:
derrickoswald
From: <tez...@ya...> - 2003-05-20 16:14:38
|
Hmm, well that breaks everything under the sun.. I have re-corrected it on my side by changing this addition into a new method resetParsed(). So more of a helper function than a major change... Obviously I've blundered in here half-cocked. Should I submit further stuff off the CVS or the 1.2 code base? I'm a bit loathe to use the CVS in production, so any patches I do I'm inclined to do off 1.2 Thoughts? If you want the diff that implements the resetParsed() and appropriate test, just email me. Cheers, Terry. --- Terry Alexis Lurie <tez...@ya...> wrote: > Hi, this is further to my Bug report via the SF > site. > > Basically, setParsed() wasn't effecting the actual > output of the Node thereafter. This made it a real > pain to highlight HTML, the example here being > making > tables have a border of 1 to show them. > > Patch attached. Has some debugging commented out, > you'll want to get rid of this. I put a patch for th > testing code on the sourceforge bug report. > > Cheers, > > Terry. > > -------------------- > > *** HTMLTag.java 2003/05/20 12:33:42 1.1 > --- HTMLTag.java 2003/05/20 14:52:42 > *************** > *** 273,283 **** > } > /** > * Sets the parsed. > ! * @param parsed The parsed to set > */ > public void setParsed(Hashtable parsed) { > this.parsed = parsed; > } > /** > * Sets the strictTags. > * @param strictTags The strictTags to set > --- 273,306 ---- > } > /** > * Sets the parsed. > ! * Note: There is no guarantee that the > attributes > will be: > ! * in the same order or case as originally. > ! * This isn't expected to be a problem, but > then again > ! * it never is, is it? > ! * Also: This currently makes no effort to place > the attribute > ! * in quotes if necessary. You have to take > care of that > ! * yourself > ! * @param parsed The hash of (key,value) > attribute > pairs to set > */ > public void setParsed(Hashtable parsed) { > this.parsed = parsed; > + > + setText((String) parsed.get(this.TAGNAME)); > //Set > the tag first > + for(Enumeration e = parsed.keys(); > e.hasMoreElements();) { > + String temp = (String) e.nextElement(); > + if (!temp.equals(this.TAGNAME)) { //Don't > add > the tagname again > + append(" " + temp + '=' + ((String) > parsed.get(temp))); > + > + //Debug > + //System.out.println("setParsed appending key: > " > + temp + " to value: " + ((String) > parsed.get(temp))); > + } > + } > + > + //Debug > + //System.out.println("setParsed: completed, now > text is:" + getText()); > + > } > + > /** > * Sets the strictTags. > * @param strictTags The strictTags to set > > > ===== > ------------------------------------------------------------ > 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 > > > ------------------------------------------------------- > This SF.net email is sponsored by: ObjectStore. > If flattening out C++ or Java code to make your > application fit in a > relational database is painful, don't do it! Check > out ObjectStore. > Now part of Progress Software. > http://www.objectstore.net/sourceforge > _______________________________________________ > Htmlparser-developer mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-developer ===== ------------------------------------------------------------ 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 |