RE: [Htmlparser-developer] Label Tag
Brought to you by:
derrickoswald
From: Somik R. <so...@ya...> - 2003-04-30 22:56:35
|
--- dha...@or... wrote: > Thanx a lot. Exactly what I needed. Pretty stupid of > me to ask ont eh > forum actually. Should have searched the javadocs > first. Sorry about it. > Will try to make sure that it does not happen again. No, sorry wont do - you have to copy 10 essays (or programs) in detention :). Chill out! > I was thinking of a setLabel wherein the user would > give a single string > (it might have many tags). Internally, setLabel() > would parse it into > its corresponding tags and assign it as the children > of the Label tag. > What do you guys think? Lemme know. That would work - but would be costly (in performance). You really dont want to rig up an internal parser just to change the label tag data. A simpler way is to find out which string node you wish to change (digupStringNode(), searchFor(), or quite simply, the exact index which you might happen to know). Then, StringNode newNode = new StringNode( newDataBuffer, 0, 0 ); To replace the child, you can either do something as simple as, getChildrenAsNodeArray()[posOfOldNode] = newNode; or NodeList nodeList = getChildren(); and make a similar modification in the nodelist. Regards, Somik __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com |