How to parse xml code to html

skolman

New Member
If i've xml feed back link as \[code\]www.my_site.com/api.php?query=something\[/code\]and the resulting is as following xml code\[code\]<api><page pageid="577" ns="0" title="something"><extract xml:space="preserve">blah blah about something blah blah</extract></page></api>\[/code\]Now how to parse this code to be shown as HTML ?! i've tried this idea but didn't worked\[code\]<?PHP$rssurl = "www.my_site.com/api.php?query=something";$xml = @simplexml_load_file("$rssurl");if($xml){foreach ($xml->extract->item as $item) {$desc = $item->extract;$latestfeeds .= "$desc";}}else{$latestfeeds = "Problem";}$body = "$latestfeeds";echo $body;?>\[/code\]It keep giving me "Problem" ! this idea might be totally wrong so any help how to do it in order to get the content of extract \[code\]blah blah about something blah blah\[/code\] ~ thanks
 
Back
Top