Ross,

Thanks again for your help. I'm just trying to remove the XML element
which has the same latitude attribute value as a certain JavaScript
variable. The XML file is stored on the server. I certainly see the
problem with using the latitude to identify the point and will follow
your good suggestion of changing to a marker ID attribute, I just want
to get this functionality working first.

I guess I hadn't fully grasped the way the client's browser interacts
with an XML file (as you say, it's just an image of that file on their
browser, and changes made to it won't affect the original source
file.. I still need to read up on XML DOM). I wonder if I can use a
similar procedure to access the XML file and write the browser's image
of the XML file back to the original as I used when writing new marker
elements to the XML file. The help you've given me in understanding
this actually clarifies what I was seeing in playing with my code.
With the code I posted above, I'm able to store the latitude (or ID)
of the marker to be removed in a JavaScript variable, and then cycle
through the latitudes (or IDs) of each marker element in the XML file.
I'm then able to check if those two variables match and, if they do,
remove that marker using the two lines:

var remove_node = xmlDoc.selectSingleNode("/marker[lat='" +
markerlatitude + "']");
xmlDoc.documentElement.removeChild(remove_node);

When I do this the marker's attributes seem to be no longer
accessible, but when I reload all of the markers from my data.xml file
nothing has actually been removed. That's why I wonder if I am missing
a command to write the client's image of the XML file back to the
original, although other examples I've seen don't seem to necessitate
anything like that (e.g., http://www.w3schools.com/DOM/dom_nodes_remove.asp).

Thanks for helping me work through this, I hope it makes sense.

Eric
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to