Why is that not working:
class XML {
var $parser;
var $Dummy;
function XML() {
$this->parser = xml_parser_create();
xml_set_object($this->parser,&$this);
xml_set_element_handler($this->parser,"tag_open","tag_close");
}
function getDummy() {
echo $this->Dummy;
}
function parseFile($uri) {
$fp = fopen($uri, "r");
$string = fread($fp, 4096);
fclose($fp);
xml_parse($this->parser,$string)
}
function tag_open($parser,$name,$attrs) {
if ($name == "DummyElement") {
$this->Dummy = $attrs['DummyAttribute'];
}
}
function tag_close($parser,$name) {}
}
$main = new XML();
$main->parseFile(dummy.xml);
$main->getDummy();
$Dummy is correctly set, but cannot be accessed via the method 'getDummy()' :-(
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]