import java.io.File;
import java.io.FileInputStream;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamReader;
public class MainClass {
public static void main(String[] args) throws Exception {
File file = new File("test.xml");
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
XMLStreamReader reader = inputFactory.createXMLStreamReader(new FileInputStream(file));
while (reader.getEventType() == 6)
reader.next();
int eventTypeID = reader.next();
System.out.println("Hello " + reader.getText());
}
}
sources68 the directory containing the programming examples, source code and programming guide online
Friday, 29 July 2011
Get event type from XMLStreamReader
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment