Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Parsing XML retrieved from URL

Posted on 2011-03-10
5
Medium Priority
?
226 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
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 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…

722 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