View Single Post
  #4 (permalink)  
Old December 11th, 2007, 10:55 AM
celticbhoy celticbhoy is offline
Registered User
 
Join Date: Dec 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Its Ok,
I sorted it out all by myself.

Here is the code I am using. It basically

Code:
function getXmlElements()
    {
        if (BrowserDetect.browser == "Explorer") 
        {
            //browserLabel="IE";
            alert("browser= " + browserLabel);

            var objectPos = document.getElementById("xmlData");

              var i = 0;
              var maxMaps = objectPosition.length;

            alert("objectPos.innerText=" + objectPos.innerText);

            var tempPos = objectPos.innerText;
            var temp = new Array();
            temp = tempPos.split(' ');

            for(i; i< temp.length -1; i+=3 )
            {
                alert("vehicleName: " + temp[i])
                alert("longitude: " + temp[i+1])
                alert("lattiude: " + temp[i+2])
            }
        }
        else
        {
            browserLabel="FireFox";
            alert("browser= " + browserLabel);

        var vehicleName;
            var latitude;
            var longitude;

             for(var i = 0; i < objectPosition.length ; i++)
               {
                    vehicleName = objectPosition[i].getElementsByTagName("vehicleName")    
                objLatitude = objectPosition[i].getElementsByTagName("latitude")            
                objLongitude = objectPosition[i].getElementsByTagName("longitude")

            alert("vehicleName: " + vehicleName[0].firstChild.data)
            alert("longitude: " + objLongitude[0].firstChild.data)
            alert("lattiude: " + objLatitude[0].firstChild.data)
         }
     }    
    }
Reply With Quote