System.Xml.XmlDataDocument.Load C# (CSharp) Méthode

Load() public méthode

Loads the XML document from the specified Stream.
public Load ( Stream inStream ) : void
inStream Stream
Résultat void
        public override void Load(Stream inStream)
        {
            _bForceExpandEntity = true;
            base.Load(inStream);
            _bForceExpandEntity = false;
        }

Same methods

XmlDataDocument::Load ( TextReader txtReader ) : void
XmlDataDocument::Load ( XmlReader reader ) : void
XmlDataDocument::Load ( string filename ) : void

Usage Example

        public IDictionary<String, String> getLatLong(String zipCode)
        {
            XmlDataDocument doc = new XmlDataDocument();
            List<String> data = new List<String>();
            String url = "http://maps.googleapis.com/maps/api/geocode/xml?address=" + zipCode;
            doc.Load(url);

            XmlNodeList status = doc.GetElementsByTagName("status");
            String res_status = status[0].InnerText;
            if (!res_status.Equals("OK"))
            {
                data.Add("No Result");
            }

            XmlNodeList result = doc.GetElementsByTagName("result");
            XmlNodeList list = null,location = null;

            String latitude = null, longitude = null;

            for (int i = 0; i < result.Count; i++)
            {
                list = doc.GetElementsByTagName("geometry");
            }
            for (int i = 0; i < list.Count; i++)
            {
                location = doc.GetElementsByTagName("location");
            }

            latitude = location[0].SelectSingleNode("lat").InnerText;
            longitude = location[0].SelectSingleNode("lng").InnerText;
            return  getWeatherData(latitude,longitude);
        }
All Usage Examples Of System.Xml.XmlDataDocument::Load
XmlDataDocument