Java Tutorial/XML/XMLInputFactory
Версия от 17:44, 31 мая 2010; (обсуждение)
Create XMLStreamReader from XMLInputFactory
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();
}
}