ok if I go like this(ie for each TD look for parent --> TR and look for its children count, if that > 6 , then this is it, remove appropriate one from nl):
for(int i = 0; i < nl.size(); i++)
{
NodeList nltest = nl.elementAt(i).getParent().getChildren();
if (nltest.size() > 6)
{
nl.elementAt(i).getParent().getChildren().remove(5);
}
}
now there is no error, shouldn't the nl.size() be now changed, it remains 29 , same as before remove.
?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
here:
http://ec.europa.eu/food/plant/propagation/catalogues/comcat_agri_2008/8.html
as you can se there is one td to the right which makes no sence, any idea how to remove it/ignore fifth column before:
tnf.setName("TD");
nl = parser.parse(tnf);
?
ok if I go like this(ie for each TD look for parent --> TR and look for its children count, if that > 6 , then this is it, remove appropriate one from nl):
for(int i = 0; i < nl.size(); i++)
{
NodeList nltest = nl.elementAt(i).getParent().getChildren();
if (nltest.size() > 6)
{
nl.elementAt(i).getParent().getChildren().remove(5);
}
}
now there is no error, shouldn't the nl.size() be now changed, it remains 29 , same as before remove.
?
my bad, correction, now it works:
for(int i = 0; i < nl.size(); i++)
{
NodeList nltest = nl.elementAt(i).getParent().getChildren();
if (nltest.size() > 6)
{
nl.remove(nltest.elementAt(5));
}
}