World News
"); //avoid the DTD declaration, non validating parse. Begin directly with channel
//parse the data
include_once("xmlclass.php");
$xml_parser = new xml();
$data = substr($data, $initPos);
$root_node = $xml_parser->parse($data);
$channel = array_shift($root_node["_ELEMENTS"]);
//Now we select some elements we want, discarding others (See rss specs 0.91, 0.92 and 2.0)
////// WHO title, description and link /////////////////////////////////////////////////////////
foreach ($channel["_ELEMENTS"] as $item){
if($item[_NAME]=="title") $base_name=stripslashes($item[_DATA]);
if($item[_NAME]=="link") $base_uri=stripslashes($item[_DATA]);
if($item[_NAME]=="description") $base_desc=stripslashes($item[_DATA]);
}
$base = "Web: $base_name
$base_desc
";
/////////////////////////////////////////////////////////////////////////
////////// ITEMS --> items, description and link ////////////////////////////////////////////////////////
foreach ($channel["_ELEMENTS"] as $item){
//printf("ITEM: %s
", $item["_NAME"]);
if($item[_NAME]=="item") {
//stripslashes is needed since providers give links inside texts or titles
foreach ($item["_ELEMENTS"] as $tag){
if($tag["_NAME"]=="title") $news_title=stripslashes($tag[_DATA]);
if($tag["_NAME"]=="link") $news_uri=stripslashes($tag[_DATA]);
if($tag["_NAME"]=="description") $news_desc=stripslashes($tag[_DATA]);
}
$news .= "
$news_title
$news_desc
$news_uri
Travelers going on vacation go Maango!
Travelers that wish they were go Biizgo!
© 2007 Atitlan Design, Lake Atitlan, Guatemala
tel: ++502-5583-8328 ~ email: