I want to show XML data in HTML, I have tried numerous tutorials but I must be doing something wrong. I want to show data within <Listing>. I want it to be something like this: <Title> - <id> Price: <Price> Closes: <EndDate> The XML file is located at: http://www.trademe.co.nz/API/MemberListingFeed.aspx?nickname=barginsdirect
What server side language are you using? There's no way to do it strictly with HTML, and Javascript for security reasons isn't supposed to be able to access files not located on the same domain. IF the xml file were locally on the same domain as the page you're using, then with JQuery (a javascript framework), you could load it like this. $(document).ready(function() { $.ajax({ type: "GET", url: "mListing.xml", dataType: "xml", success: parseXml }); }); function parseXml(xml) { //find every Listing block and append it to the DisplayDiv $(xml).find("Listing").each(function() { //use attr insted of find if the value is stored as an attribute instead of a tag. $("#displayDiv").append($(this).find("Title").text() + ... so on ... + "<br />"); $("#displayDiv").append($(this).find("Date").text()); $("#displayDiv").append(": " + $(this).find("Price").text() + "<br />"); }); } Code (markup): Course you could probably get around the cross-domain issue by making PHP load the xml data remotely, but if you had serverside capabilities probably better just parsing the XML from PHP first anyways.