Page 1 of 1
importing xml help
Posted: Tue Aug 24, 2010 10:32 am
by generic88
Hi,
This may seem like a stupid question, but I'm quite new to php.
http://demo.gallerycms.com/index.php/view
Is it possible to import a string of xml from this url into php?
I've tried using simplexml, include, etc to import it, but with no luck
Thanks
Re: importing xml help
Posted: Tue Aug 24, 2010 11:00 am
by AbraCadaver
Depends upon what you mean by import. What do you want to do with it?
Re: importing xml help
Posted: Wed Aug 25, 2010 6:00 am
by generic88
Hi AbraCadaver,
sorry, I wasnt very clear there.
At this point I just want to drop the full stream of xml into a page of html, keeping all formatting etc. I'm just not sure what to do with the way it ends in /index.php/view rather than just being a .xml file.
Thanks
Re: importing xml help
Posted: Wed Aug 25, 2010 10:41 am
by AbraCadaver
It doesn't matter what the path is, you can't display an XML file inside of an HTML page and have it appear as it does in the browser because you've already defined the page as HTML not XML. You can load the XML file and loop through it with PHP and display it how you want. Try
http://us3.php.net/manual/en/simplexml. ... -basic.php
Re: importing xml help
Posted: Mon Aug 30, 2010 6:37 am
by generic88
Hi Abra,
Thanks a million, I thought the problem was with the path but now I've a better understanding of what I'm doing wrong.