Changeset 9949 in osm for applications/editors/josm/plugins/waypoints/src/WaypointReader.java
- Timestamp:
- 2008-08-18T16:47:03+02:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/waypoints/src/WaypointReader.java
r1495 r9949 7 7 import java.io.InputStreamReader; 8 8 9 import javax.xml.parsers.SAXParserFactory; 10 import javax.xml.parsers.ParserConfigurationException; 11 9 12 import org.openstreetmap.josm.data.coor.LatLon; 10 13 import org.openstreetmap.josm.data.osm.DataSet; // NW … … 12 15 import org.xml.sax.Attributes; 13 16 import org.xml.sax.SAXException; 14 15 import uk.co.wilson.xml.MinML2; 16 17 import org.xml.sax.InputSource; 18 import org.xml.sax.helpers.DefaultHandler; 17 19 18 20 /** … … 21 23 public class WaypointReader { 22 24 23 private static class Parser extends MinML2{25 private static class Parser extends DefaultHandler { 24 26 /** 25 27 * Current track to be read. The last entry is the current trkpt. … … 99 101 */ 100 102 public static DataSet parse(InputStream source) 101 throws SAXException, IOException{ 103 throws SAXException, IOException, ParserConfigurationException { 102 104 Parser parser = new Parser(); 103 parser.parse(new InputStreamReader(source, "UTF-8"));105 SAXParserFactory.newInstance().newSAXParser().parse(new InputSource(new InputStreamReader(source, "UTF-8")), parser); 104 106 return parser.dataSet; 105 107 }
Note:
See TracChangeset
for help on using the changeset viewer.
