Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all,
Vanilla are planning an update to the site on April 24th (next Wednesday). It is a major PHP8 update which is expected to boost performance across the site. The site will be down from 7pm and it is expected to take about an hour to complete. We appreciate your patience during the update.
Thanks all.

Using XML live file from remote URL

Options
  • 23-04-2013 5:00pm
    #1
    Registered Users Posts: 396 ✭✭


    Hi there

    I want to try and pull an XML file from a remote website which updates the data in the file every couple of minutes. I thought it would be relatively simple to do, but have struggled to find ways of grabbing this info and laying it out into a nice HTML5 layout. Would anybody have any suggestions on how to do this. I can post up the URL to the XML file if need be.

    Thanks

    Rob


Comments

  • Registered Users Posts: 7,500 ✭✭✭BrokenArrows


    Are you failing to grab the xml file or are you failing to display it in HTML5?

    And what language are you trying to read the xml file in?


  • Registered Users Posts: 2,790 ✭✭✭John_Mc


    How about being a little more specific. What language/framework are you using? What code have you already written?


  • Registered Users Posts: 396 ✭✭RobTheLad


    sorry if i was vague in the previous post, basically, I want to take data from an XML file which updates every few minutes. I want to be able to pull the data from the XML file every time the html page is loaded, so it is showing the most up to date information. The problem I am having is trying to pull the XML data from a remote URL. When I have the data pulled I am going to re-structure the info into a HTML5/JQuery mobile page, so it can be accessed on a phone or tablet device also. I have tried using PHP, but I'm not very familar with PHP, never have done it before, so is kind of confusing


  • Registered Users Posts: 2,790 ✭✭✭John_Mc


    Are you trying to do this on the server side or client? If the former, what framework (PHP, .Net, Java etc).


  • Registered Users Posts: 396 ✭✭RobTheLad


    John_Mc wrote: »
    Are you trying to do this on the server side or client? If the former, what framework (PHP, .Net, Java etc).

    Preferably on the client. I've tried doing it in PHP, but as I mentioned, I have very little experience with PHP, would there be a way using jQuery or Javascript to do this? The link to the XML file is

    http://www.dublincity.ie/dublintraffic/cpdata.xml


  • Advertisement
  • Closed Accounts Posts: 350 ✭✭mickgotsick


    You can use the XMLHttpRequest object to retrieve xml data in Javascript:

    http://www.w3schools.com/xml/xml_http.asp


  • Moderators, Technology & Internet Moderators Posts: 1,333 Mod ✭✭✭✭croo




  • Moderators, Society & Culture Moderators Posts: 9,689 Mod ✭✭✭✭stevenmu


    You can use Jquery Get to request the file, and then use [url="http://api.jquery.com/jQuery.parseXML/]parseXML()[/url] to process it.


Advertisement