I have found a SAX code in the internet and tried it with my XAMPP and it works... But when I applied it to Drupal blocks (php code input format) it doesn't perform what it is supposed to do... Please help.... What causes this thing to happen? Is there a way to make it perform its supposed task... Here is the code:
<?php
class xItem {
var $xTitle;
var $xLink;
var $xDescription;
}
// general vars
$sTitle = "";
$sLink = "";
$sDescription = "";
$arItems = array();
$itemCount = 0;
// ********* Start User-Defined Vars ************
// rss url goes here
$uFile = "http://www.wirelessweek.com/rssFeed.aspx?type=3";
// descriptions (true or false) goes here
$bDesc = true;
// font goes here
$uFont = "Verdana, Arial, Helvetica, sans-serif";
$uFontSize = "2";
// ********* End User-Defined Vars **************
function startElement($parser, $name, $attrs) {
global $curTag;
$curTag .= "^$name";
}
function endElement($parser, $name) {
global $curTag;
$caret_pos = strrpos($curTag,'^');
$curTag = substr($curTag,0,$caret_pos);
}
function characterData($parser, $data) { global $curTag;
// get the Channel information first