A client is having me do some work with plotting hotels on Google Maps. All is well, but I want to return the number of hotel in the given bounds. The hotels are returned through XML via PHP. The XML format is as follows…
<markers> <num>262</num> <marker hid="2" name="A and A Hotel Florence" address="Via Tagliaferri, 40, 72018 San Michele Salentino, Brindisi (Puglia), Italy" lat="17.632141" lng="40.631351" type="hotel"/> <marker ..../> </markers>
Now, I retrieve the data with google’s xml parser…
var xml = GXml.parse(data); var markers = xml.documentElement.getElementsByTagName("marker"); var numr=xml.documentElement.getElementsByTagName("num");
I use a for loop with var xml, all goes well there.
I call the <num> from the xml with var numr… but all I get when I try sticking it in a DIV, is ‘object Element’.