Create XMLStreamReader from XMLInputFactory : XMLInputFactory « XML « Java Tutorial






import java.io.FileInputStream;

import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamReader;

public class FISTest {
  public static void main(String[] args) throws Exception {
    XMLInputFactory factory = XMLInputFactory.newInstance();
    FileInputStream fis = new FileInputStream("c.xml");
    XMLStreamReader reader = factory.createXMLStreamReader(fis);
    reader.close();
    fis.close();

  }

}








33.12.XMLInputFactory
33.12.1.Create XMLStreamReader from XMLInputFactory