Beispiel #1
0
        public override object parse(XmlNode objNode)
        {
            // get required poi's parameters
            string name      = objNode.SelectSingleNode("name").InnerText.Trim();
            double latitude  = Convert.ToDouble(objNode.SelectSingleNode("latitude").InnerText.Trim());
            double longitude = Convert.ToDouble(objNode.SelectSingleNode("longitude").InnerText.Trim());
            string lang      = objNode.SelectSingleNode("lang").InnerText.Trim();
            string type      = objNode.SelectSingleNode("type").InnerText.Trim();
            string descr     = objNode.SelectSingleNode("descr").InnerText.Trim();
            // instantiate poi
            Poi poi = new Poi(name, latitude, longitude, lang, type, descr);
            // parse media files

            MediaFilesXmlAdapter mediaFilesParser = new MediaFilesXmlAdapter(poi.getMediaFiles());
            XmlNode mediaFilesNode = objNode.SelectSingleNode(mediaFilesParser.getXmlNodeName());

            mediaFilesParser.parse(mediaFilesNode);

            MainDetailsXmlAdapter mainDetailsParser = new MainDetailsXmlAdapter(poi.getMainDetails());
            XmlNode mainDetailsNode = objNode.SelectSingleNode(mainDetailsParser.getXmlNodeName());

            mainDetailsParser.parse(mainDetailsNode);

            return(poi);
        }
Beispiel #2
0
        public override object parse(XmlNode objNode)
        {
            string title = objNode.SelectSingleNode("title").InnerText.Trim();
            string descr = objNode.SelectSingleNode("descr").InnerText.Trim();
            MainDetail mainDetail = new MainDetail(title, descr);
            // parse media files
            MediaFilesXmlAdapter mediaFilesParser = new MediaFilesXmlAdapter(mainDetail.getMediaFiles());
            XmlNode mediaFilesNode = objNode.SelectSingleNode(mediaFilesParser.getXmlNodeName());
            mediaFilesParser.parse(mediaFilesNode);

            return mainDetail;
        }
Beispiel #3
0
        public override object parse(XmlNode objNode)
        {
            string     title      = objNode.SelectSingleNode("title").InnerText.Trim();
            string     descr      = objNode.SelectSingleNode("descr").InnerText.Trim();
            MainDetail mainDetail = new MainDetail(title, descr);
            // parse media files
            MediaFilesXmlAdapter mediaFilesParser = new MediaFilesXmlAdapter(mainDetail.getMediaFiles());
            XmlNode mediaFilesNode = objNode.SelectSingleNode(mediaFilesParser.getXmlNodeName());

            mediaFilesParser.parse(mediaFilesNode);

            return(mainDetail);
        }
Beispiel #4
0
        public override object parse(XmlNode objNode)
        {
            // get required poi's parameters
            string name = objNode.SelectSingleNode("name").InnerText.Trim();
            double latitude = Convert.ToDouble(objNode.SelectSingleNode("latitude").InnerText.Trim());
            double longitude = Convert.ToDouble(objNode.SelectSingleNode("longitude").InnerText.Trim());
            string lang = objNode.SelectSingleNode("lang").InnerText.Trim();
            string type = objNode.SelectSingleNode("type").InnerText.Trim();
            string descr = objNode.SelectSingleNode("descr").InnerText.Trim();
            // instantiate poi
            Poi poi = new Poi(name, latitude, longitude, lang, type, descr);
            // parse media files

            MediaFilesXmlAdapter mediaFilesParser = new MediaFilesXmlAdapter(poi.getMediaFiles());
            XmlNode mediaFilesNode = objNode.SelectSingleNode(mediaFilesParser.getXmlNodeName());
            mediaFilesParser.parse(mediaFilesNode);

            MainDetailsXmlAdapter mainDetailsParser = new MainDetailsXmlAdapter(poi.getMainDetails());
            XmlNode mainDetailsNode = objNode.SelectSingleNode(mainDetailsParser.getXmlNodeName());
            mainDetailsParser.parse(mainDetailsNode);

            return poi;
        }