reader.addHandler("/ArrayOfHotelInfoForIndex/HotelInfoForIndex", new ElementHandler(){
public void onStart(ElementPath path) {}
public void onEnd(ElementPath path) {
Element row = path.getCurrent();
row.detach();
Element nameElement = row.element("name");
......
}
try{
FileInputStream fis = new FileInputStream(new File(filePath));
reader.read(fis);
fis.close();
}catch(DocumentException e){
log.error("格式错误:"+e.getMessage())
}finally{...}
这样的节点错误直接就到catch里了,后面就没了
现在是想如果哪个节点是错误的格式,那这个节点就跳过去,继续读取下面的节点,如果下面第二个user错误的话,就跳过这个,读取第三个