Page 1 of 1

xml parsing

Posted: Tue Mar 28, 2006 6:14 pm
by nincha
trynig to do this, but recieves error because cant call functions for open tag, close tag and data.

Code: Select all

class thingy{

	function tagOpen($parser, $element) {	// call when open
	
	}
	
	function tagData($parser, $data) { //call for data
	}
	
	function tagClose() { //call when close
	
	}

                function letsParse{
                
                	$parser = xml_parser_create();
		xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, false);
		xml_set_element_handler($parser, "tagOpen", "tagClose");
		xml_set_character_data_handler($parser, "tagData");
		xml_parse($parser, $xmlString);
		xml_parser_free($parser);	
	}


}

Posted: Tue Mar 28, 2006 6:23 pm
by nincha
aye nm, i got it.... forgot xml_set_object($parser,$this); ........................... = - /, wasted an hour there.....