Examples of FastXmlParser


Examples of org.openstreetmap.osmosis.xml.v0_6.impl.FastXmlParser

    /**
     * Reads all data from the file and send it to the sink.
     */
    public void run() {
      InputStream inputStream = null;
      FastXmlParser parser = null;
     
      try {
        sink.initialize(Collections.<String, Object>emptyMap());
       
        // make "-" an alias for /dev/stdin
        if (file.getName().equals("-")) {
          inputStream = System.in;
        } else {
          inputStream = new FileInputStream(file);
        }
       
       
        inputStream =
          new CompressionActivator(compressionMethod).
            createCompressionInputStream(inputStream);
       
            XMLInputFactory factory = XMLInputFactory.newInstance();
            factory.setProperty(XMLInputFactory.IS_COALESCING, false);
            factory.setProperty(XMLInputFactory.IS_NAMESPACE_AWARE, false);
            factory.setProperty(XMLInputFactory.IS_VALIDATING, false);
            XMLStreamReader xpp = factory.createXMLStreamReader(inputStream);
       
        parser = new FastXmlParser(sink, xpp, enableDateParsing);
       
        parser.readOsm();
       
        sink.complete();
       
      } catch (Exception e) {
        throw new OsmosisRuntimeException("Unable to read XML file " + file + ".", e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.