Menu

#53 custom visitor issues

open
nobody
5
2008-01-12
2008-01-12
Screwt-k
No

Hi, i'm coding a little application using a custom visitor. the probleme is that, my visitor stuck this way:

the code:

[code]
package ogwalker;
import org.htmlparser.visitors.NodeVisitor;
import org.htmlparser.*;
import java.util.*;
/**
*
* @author ben
*/
public class PlaneteVisitor extends NodeVisitor{
private List<Planete> planete;
public void visitTag(Tag tag){
//System.out.println(tag.getTagName());
Character tab = (char)9;
if(tag.getTagName().equals("OPTION")){
String position = tag.toPlainTextString().split(tab.toString())[4];

int [] i = {new Integer(position.substring(3, position.length()-1).split(":")[0]),
new Integer(position.substring(3, position.length()-1).split(":")[1]),
new Integer(position.substring(3, position.length()-1).split(":")[2])
};

System.out.println(i[1]);
//planete.add(new Planete(tag.toPlainTextString().split(tab.toString())[0],i)); System.out.println(planete.get(0).getName());
//the nextline stuck the vivitor planete.add(tag.toPlainTextString().split(tab.toString())[0]);

}
}

public List getPlanetes(){
return planete;
}
}
[/code]

and when i delete the line:
planete.add(tag.toPlainTextString().split(tab.toString())[0],i);

my vivitor reach all the <SCRIPT> tag normally

Discussion


Log in to post a comment.