Renidrag Posted February 20, 2008 Share Posted February 20, 2008 I am using the XML_Paser to parse Yahoo Search XML and it has been years since I worked with XML and these classes and functions in PHP are new to me, I can easily go throught and display the search listings that are contained in the attributes - BUT - I can not display the value of the text within the ClickURL element, I can only seen to get display element attributes with my function start($parser,$element,$attr) I was looking into using Simple XML but the hosting service only uses php 4.3.9 and Simple XML requires PHP 5 Can someone show me how to display the text within the element, not the attributes, thanks Quote Link to comment https://forums.phpfreaks.com/topic/92054-php-xml-paser/ Share on other sites More sharing options...
Renidrag Posted February 20, 2008 Author Share Posted February 20, 2008 Update, I found the solution, when using xml_parser() you set the xml_set_element_handler($this->parser,"start","stop"); which iterates through the xml feed, during this iteration the xml_set_character_data_handler($this->parser,"char"); is called and you use the function set above "char" to handle the data within the xml elements where as the "start" and "stop" functions handle the element attributes. So basically the xml_parser is setup to do these steps, you have to set the name you want on the functions and you get to tell the functions what they will do - Documentation could be better thou and some examples of the flow of iteration etc. but all in all my faith is restored Quote Link to comment https://forums.phpfreaks.com/topic/92054-php-xml-paser/#findComment-471781 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.