Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Parsing XML retrieved from URL

Posted on 2011-03-10
5
Medium Priority
?
227 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 1000 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 1000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

963 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