You need to sign in to do that
Don't have an account?

XMLStreamReader class's continue; statement not working
Hi all,
I have one problem of 'continue;' statement.
XmlStreamReader reader = new XmlStreamReader(docContent);
while(reader.hasNext()){
if (reader.getEventType() == XmlTag.END_ELEMENT) {
continue;
}
elseif(reader.getEventType() == XmlTag.CHARACTERS
reader.getText();
}
reader.next();
}
i want to when ever meet the event type is END_ELEMENT the loop will terminate and go to next iteration. we all knew that 'continue' could proceed as the same. but here the if(Red marking) condition only repeated till the limit exception(20000 times). but i want to only terminate the iteration which met condition. If i put break; means terminate the overall loop. what to do..
Call next() before continue or restructure your code as an if-then-else setup.