I must be an XML parser idiot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Good afternoon gurus and gurettes!

***** example code *****
/* functions for XML parser */
function dataHandler($parser, $data){
	echo $data . "<br>\n";
}
function StartTag($parser, $name, $attribute){
	if("servicebrandname" == $name){
		echo "-----<br>\n";
	}
}
function EndTag($parser, $name){
	if("servicebrandname" == $name){
		echo "-----<br>\n";
	}
}

/* create a parser */
if(!($covadParser = xml_parser_create())){
	echo "Failed to create parser<br>\n";
	exit();
}
/* set handlers for parser */
xml_set_character_data_handler($covadParser, "dataHandler");
xml_set_element_handler($covadParser, "StartTag", "EndTag");

/* let's parse! */
if(($readXML = fopen("/usr/feynman/ADHOC/covad/testRecp.xml", "r"))){
	while($lineXML = fread($readXML, 1024)){
		echo $lineXML;
		xml_parse($covadParser, $lineXML, TRUE);
	}
}
***** end code *****

I expect what I get back to look like....
TeleSurfer DSL+IP - Shared Line (Professional-Install) 
SOHO Internet Access 6.0/768 (Self-Install)

But it is not coming back this way. Do I posess a fundamental
misunderstanding of the way the xml parser is supposed to work?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux