Hello, I have an issue that I am not quite sure how to overcome.
It goes as follows:
I have an xmlparser php script (parser.php). In this script there is for functions.
// handles the attributes for opening tags
// $attrs is a multidimensional array keyed by attribute
// name and having the value of that attribute
function startElement($parser, $name, $attrs='') {
// $current_tag lets us know what tag we are currently
// dealing with - we use that later in the characterData
// function.
//
// when we see a </Listing> we know that it is time to
// flush our temp variables and prepare to move onto
// the next one
function endElement($parser, $name, $attrs='') {
// this function is passed data between elements
// the $data would equal 'Title Here'
// in the line <TITLE>Title Here</TITLE>
function characterData($parser, $data) {
The last function return_page() is called from endElement and it simply outputs the data to the screen.
The XML parser works fine. If I simply run the parser.php script by it self it outputs the results fine. However, this is not want I want it to do.
I want to include('parser.php') in another script. The other script is suppose to be able to set the $fQuery variable that parser.php uses and I want the other script to be able to access the $temp array with the results from the xml feed.
What I have tried so far is to include('parser.php') and then call the function return_page after the include to display the data, but this is not working.
Anyone understand and able to help me with this problem?
Thanks.
The first two functions are used in the xml_set_element_handler.