Re: [Htmlparser-developer] Label Tag
Brought to you by:
derrickoswald
From: Somik R. <so...@ya...> - 2003-05-02 15:55:06
|
> Well the Node [] returned by getChildrenAsNodeArray is a copy of the > original children nodelist. I used the NodeList obtained from > getChildren() and changed contents in that to get my work done. It > worked!!! Ah yes, I recall the copy now. > How about a removeAll(). Felt the need for that since I was replacing > the entire child list with a single node. Will be useful for others also > who want to change number of child nodes. At present I had to remove > each one individually. Only advantage ofcourse is cleaner (not to > mention easier) developer code. > Sounds good. I didn't need it, so didn't put it, but if you do - go ahead. > Now for the setLabel method of LabelTag. Considering all things(i.e. as > much as my mind can think of), how about using a NodeList as a > parameter? Developers can either use the orginal NodeList with some > modifications or create an entirely new one and pass it to the method > which in turn will effetively replace the childTags variable in > CompositeTag. An overloaded String parameter based one can also be given > with information related to its possible slow performance due to > internal parsing. All this is only to shield users from inner-level > code. Otherwise everything that is required to be done can get done but > only after getting some knowledge over these mailing lists......thanx to > somik and Derrick. > It is doubtful that users of the parser will normally need this. Advanced users would - who write their own scanners. We'd probably like them to know something about the internals - not too much of course. Striking the right balance is hard. Its always good to revisit a problem. Now that you know what you do, what do you think is the minimum and simplest, given that you don't want to lose performance ? (You are in the advanced user category now) > Also can we have a no-args constructor for LabelScanner. I think I had > sent these files to Somik for updation into CVS (alongwith SelectTag to > use NodeList instead of List) Hmm.. I seem to have misplaced them (apologies). Can you mail them to Derrick ? Derrick-> Dhaval is inside a firewall, and does not have access to our CVS repository. Regards, Somik |