Solved

Parsing XML retrieved from URL

Posted on 2011-03-10
5
219 Views
Last Modified: 2012-08-13
Hi

I have parsed XML in PHP before from standing XML files however the project I am working on at the moment requires something slightly different.

The XML has to be retreived from a .exe file using a URL. The .exe is in the same directory as the php file.

When the URL is called it responds with the XML.

I dont know how to parse this in XML as the only knowledge I have of parsing XML is when it is stored in a .xml file.

Does anyone have any ideas if this can be done and if so how?

Many Thanks,

Daz
0
Comment
Question by:DAZTOMKINS
5 Comments
 
LVL 13

Accepted Solution

by:
dsmile earned 250 total points
ID: 35104534
If URL's response is valid XML, then the only different is how you use the handle/resource.

For .xml file, you have to open a handle to parse the file as the resource.
For your case, you already have the resource you need.
Just skip the opening file part, the rest is the same.
0
 
LVL 13

Expert Comment

by:dsmile
ID: 35104540
In addition, if it's still hard for you, then just save what URL returns to a temp file, then open that temp file as an XML file
0
 
LVL 27

Expert Comment

by:Lukasz Chmielewski
ID: 35106057
What happens when you execute that exe file ?
0
 
LVL 34

Assisted Solution

by:Beverley Portlock
Beverley Portlock earned 250 total points
ID: 35106505
If you are executing the exe by calling a URL then you can load the resulting XML directly via simplexml_load_file (see http://www.pnp.net/simplexml_load_file ).

I think the key to this is how you intend to 'execute' the .exe since many systems will explicity block .exe fies
0
 

Author Closing Comment

by:DAZTOMKINS
ID: 35133495
Thank you for your help.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now