Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9252829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:03:21+00:00 2026-06-18T11:03:21+00:00

This my code. I get data from xml. But it’s not working.. Please look

  • 0

This my code.
I get data from xml.
But it’s not working..
Please look it where is there error.
I can’t find it.. I am working on it for more than a week…

But nothing:(

P.S. Sorry for my English..

This is my XML data..

 <marker>
<line id_line="1" colour="#ccc" width="4" users="line" coordinats="47.828979,40.974844;47.839451,40.985211;47.848377,40.981064;47.853699,40.984822">
<point lng="40.974844" lat="47.828979"/>
<point lng="40.985211" lat="47.839451"/>
<point lng="40.981064" lat="47.848377"/>
<point lng="40.984822" lat="47.853699"/>
</line>
</marker>

JavaScript:

function line() {
            var point=[];
            downloadUrl("line.php", function(data) {
        var xml = data.responseXML;
        var markers = xmlDoc.documentElement.getElementsByTagName("marker");                             
        var lines = xmlDoc.documentElement.getElementsByTagName("line");
        for (var a = 0; a < lines.length; a++) {
        var colour = lines[a].getAttribute("colour");
        var width  = parseFloat(lines[a].getAttribute("width"));
        var points = lines[a].getElementsByTagName("point");

  alert (points[i].getAttribute("lat"));

 var pts = [];
            for (var i = 0; i < points.length; i++) {
               pts[i] = new google.maps.LatLng(parseFloat(points[i].getAttribute("lat")),
                                   parseFloat(points[i].getAttribute("lng")));
            }
            new google.maps.Polyline(pts,colour,width);
            pts.setMap(map);
          }




  google.maps.event.addListener(pointpath,'mouseover', function() {


        this.setOptions({strokeColor: '#3ADF00' });
           this.setOptions({strokeOpacity: 1.0 });
           this.setOptions({strokeWeight: 4 });
  });

     google.maps.event.addListener(pointpath,'mouseout', function() {


        this.setOptions({strokeColor: '#FF0040' });
           this.setOptions({strokeOpacity: 1.0 });
           this.setOptions({strokeWeight: 2 });
  });




       var mpenc = new google.maps.InfoWindow();
  var contentString = "Status: " + status ;
  google.maps.event.addListener(pointpath,'click', function(event) {
    mpenc.setContent(contentString);
    mpenc.setPosition(event.latLng);
    mpenc.open(map);
  });

 }

     });  
    function downloadUrl(url, callback) {
      var request = window.ActiveXObject ?
          new ActiveXObject('Microsoft.XMLHTTP') :
          new XMLHttpRequest;

      request.onreadystatechange = function() {
        if (request.readyState == 4) {
          request.onreadystatechange = doNothing;
          callback(request, request.status);
        }
      };

      request.open('GET', url, true);
      request.send(null);
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:03:22+00:00Added an answer on June 18, 2026 at 11:03 am

    What is xmlDoc supposed to be?

        var xml = data.responseXML;
        var markers = xmlDoc.documentElement.getElementsByTagName("marker");                             
        var lines = xmlDoc.documentElement.getElementsByTagName("line");
    

    Looks like this line:

        var xml = data.responseXML;
    

    should be:

        var xmlDoc = data.responseXML;
    

    If that doesn’t help, see this tutorial in the Google Maps API v3 documentation, the section “Outputting XML with PHP” and the part about checking that the XML output works.

    Make sure you have this line:

    header("Content-type: text/xml");
    

    And the headers include the correct content type. Open the XML in your browser and/or run it through a validator (requestXML will be null if the XML is not valid).

    Example with slightly modified xml

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the code I am using to get the xml data from Apple's
I have the following Java code working with XPath to get data from XML
I am currently using this code to get data from a URL: NSURL *url
I am using this line of code to get two data entries from an
i have this simple code to load data from other php page using get
I used the following code to fetch data from XML to Excel. But the
I am pulling data from an XML feed via C# code. When I get
At the moment i've got the following code to get data from an xml
Here is the code: This is were I take data from XML (this works,
This code works fine when you remove the <data> wrapper, from the XML and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.