Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-20-2008, 10:14 AM   PM User | #1
lse123
Regular Coder

 
Join Date: Dec 2005
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
lse123 is infamous around these parts
If I have a rss feed in csv I may use PHP to get it , well if the feed is in xml I mu

If I have a rss feed in csv I may use PHP to get it , well if the feed is in xml I must also use PHP ? Or may use or may do NOT use PHP ? What to use for:
httprequest.open(...?...); // ?
what to use in PHP file (for xml feeds non csv) ?
lse123 is offline   Reply With Quote
Old 12-24-2008, 05:33 PM   PM User | #2
KeithLawless
New to the CF scene

 
Join Date: Dec 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
KeithLawless is an unknown quantity at this point
I'd start with code like this:

<code>
<?php
$input = file_get_contents($url) or die('Could not access file: $url');
$xmlobj = simplexml_load_string($input);

print_r($xmlobj);
?>
</code>

This will get the XML document at $url (the rss feed), convert it into a PHP object, and dump out the resulting object so you can see what the structure of the object looks like.

You can use normal object notation ($xmlobj->attribute) to access parts of the rss feed object after that. Mostly these will take the form of php arrays that you can use a foreach loop to process.

Hope this helps!
Keith
http://www.keithlawless.com
KeithLawless is offline   Reply With Quote
Old 12-26-2008, 11:05 AM   PM User | #3
lse123
Regular Coder

 
Join Date: Dec 2005
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
lse123 is infamous around these parts
You mean if I have an rss.xml doc I may or not , use a php file ? correct / no-correct
If I use php I may use PHP arrays and If I do not use php I must use getElementById for the xml file ?
Tell me the way if I have a doc eg rss.xml not use php to parse ?
lse123 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:37 PM.


Advertisement
Log in to turn off these ads.