Retrieve XML Node With Specific Value In downloadURL

josh69

New Member
I wonder whether someone may be able to help me please. Firstly, my apologies as to some this be a very basic question, I'm very new to working with XML so please bear with me.I'm using this section of code to successfully load marker data from a MySQL database, placing them on a Google map.\[code\] downloadUrl("loadallmyfinds.php", function(data) { var xml = parseXml(data); var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { // obtain the attribues of each marker var lat = parseFloat(markers.getAttribute("findosgb36lat")); var lng = parseFloat(markers.getAttribute("findosgb36lon")); var point = new google.maps.LatLng(lat,lng); var locationname = markers.getAttribute("locationname"); var finddescription = markers.getAttribute("finddescription"); var html = "<b>" + 'Description: ' + "</b>" + finddescription; var findcategory = markers.getAttribute("findcategory"); // create the marker var marker = createMarker(point,html,locationname,finddescription,findcategory); } \[/code\]XML Output\[code\]<markers><marker userid="27" findid="1" locationname="Test Location 1" findosgb36lat="53.0000" findosgb36lon="-1.00000" osgridref="" dateoftrip="21/06/2012" findcategory="Artefact" finddescription="A rare Roman vase."/></markers>\[/code\]The problem I have, is that in it's current state all records are being retrieved irrespective of the user, but I need to make this user specific, to be more precise, if the \[code\]userid\[/code\] element value matches the variable I have on my form which is \[code\]$idnum\[/code\].I thought that I may be able to do this via the PHP query that is being loaded in the above i.e. \[code\]loadallmyfinds\[/code\] using a \[code\]GET\[/code\] clause, but sadly this doesn't work.I've done some research into this and I believe, from my limited knowledge, that I may be able to this via XML, but I'm really not sure how to implement it.i just wondered whether someone could possibly look at this please and offer some guidance on how I may go about it so the records are filtered.Many thanks and kind regards
 
Back
Top