Code snippets for symfony 1.x

Navigation

Snippets tagged "xmldoc"

To access an XML Doc and get info.

//Since the FAA is using Lotus Domino we can request XML representation of the FAA's //STC TOC page to get a list of valid STC documents to download from. This greatly simplifies //the process parsing the data.

        //The XML document
        XmlDocument xDoc = new XmlDocument();
        XmlElement xElem = null;
 
        while(true)
        {
            try
            {
                if (DoLogging)
                    swLog.WriteLine("Getting Number of entries

http://www.airweb.faa.gov/Regulatory_and_Guidance_Library/rgSTC.nsf/STCNumber!ReadViewEntries&Start=0&Count=0");

                //Since we have a well formed URI we can load the XML doc directly from the website and
                //not have to worry about downloading it ourself.
                //The URI of the document is in the format URL + database + view name (*.nsf) + action (ReadViewEntries returns an XML representation + Start

(document to start with) + Count (number to retireve)) //See ../../Resources/URL_cheatsheet.pdf for more information (also in the Docs folder of the project itself) xDoc.Load(new XmlTextReader(mUNIDsURL +"/STCNumber!ReadViewEntries&Start=0&Count=0"));

                //The root element of the XML doc is the viewentries element.  Get a reference 
                //to this element.
                xElem = xDoc["viewentries"];
 
                //The root element contains an attribute with the total number of STCs we'll be 
                //downloading.  If this is the first itteration through we need to populate iCount with
                //that number.
                return int.Parse(xElem.Attributes["toplevelentries"].Value);
by Umar Adeeb on 2007-08-01, tagged xmldoc