Ejemplo n.º 1
0
        static void ProcessFile(string filename, WaypointCollector collector)
        {
            try
            {
                XmlDocument a_doc = new XmlDocument();
                a_doc.Load(filename);

                //XmlNamespaceManager nsmgr = new XmlNamespaceManager(a_doc.NameTable);
                //nsmgr.AddNamespace("1", a_doc.DocumentElement.NamespaceURI);

                var waypoints = a_doc.GetElementsByTagName("wpt");
                foreach (XmlElement waypoint in waypoints)
                    collector.AddWaypoint(waypoint, filename);
            }
            catch(Exception ex)
            {
                Console.WriteLine(string.Format("{0}: {1}", filename, ex.Message));
            }
        }