Found a sample STaX code in below link: http://www.javarants.com/2006/04/30/simple-and-efficient-xml-parsing-using-jaxb-2-0/comment-page-1/
The below code doesn't work. I am not what is missing.
JAXBContext ctx = JAXBContext.newInstance("com.sampullara.findbugs.om");
Unmarshaller um = ctx.createUnmarshaller();
int bugs = 0;
while (xmlfer.peek() != null) {
Object o = um.unmarshal(xmler);
if (o instanceof BugInstance) {
BugInstance bi = (BugInstance) o;
// process the bug instance
bugs++;
}
}
What is missing in the above code?