On Jul 16, 3:37 pm, Jason <[email protected]> wrote: > I am trying to load an xml file such as listed below and get the > 'nodeValue' for each in order to create some markers but am not able > to pull out the nodeValue. I can access the nodeName and nodeType just > find but nodeValue always returns NULL. > > Any tips, pointers, etc are appreciated... I have googled around and > have not been able to get this one bit of code to work properly.
I have no problem parsinig the element content of xml in the format below. I know I have seen examples (and this same question) posted to the group before, you can search for those. Perhaps if you post a link that uses GXml.value (which addresses cross browser issues), we can see what you are doing wrong. -- Larry > > <markers> > <marker catagory="lodging"> > <title><b>Awesome Alaska Adventures Lodge</b></title> > <lat>60.512991</lat> > <lng>-150.794842</lng> > <text><a href="http://www.awesomealaskaadventures.com" > target="_blank">www.awesomealaskaadventures.com</a><br/>Gary & Amy > Gerfen<br/>35050 Betty Lou Drive<br/>Sterling, AK. 99672<br/>(907) > 260-3162 lodge<br/>(425) 223-2303 cell</text> > </marker> > </markers> > > var xmlDoc = loadXMLDoc("scripts/xml/fishingdata.xml"); > var x = xmlDoc.getElementsByTagName("marker")[0].childNodes; > var y = xmlDoc.getElementsByTagName("marker")[0].firstChild; > for (var i = 0; i < x.length; i++) { > if (y.nodeType == 1) { > alert(y.nodeName + " =>" + y.nodeValue); > } > y = y.nextSibling; > } --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
