
 Markus Möller - 2007-09-11 09:08:30
Hi all,
I tried to parse two files one after another. The first attempt was to copy all lines like this:
$xml_file="demo1.xml";
$xml=new XML();
$xml->file_read($xml_file);
$xml->parse();
$xml->debug();
$xml_file="demo2.xml";
$xml=new XML();
$xml->file_read($xml_file);
$xml->parse();
$xml->debug();
Unfortunately this results in several error-messages like this:
Warning: xml_parse(): Unable to call handler tag_data() in myTopSecretDir/XML.class.php on line 53
Warning: xml_parse(): Unable to call handler tag_open() in myTopsecretDir/XML.class.php on line 53
After this I tried to reuse the XML instance:
$xml_file="demo1.xml";
$xml=new XML();
$xml->file_read($xml_file);
$xml->parse();
$xml->debug();
$xml_file="demo2.xml";
$xml->file_read($xml_file);
$xml->parse();
$xml->debug();
Bad idea! Now there are less warnings:
Warning: xml_parse(): 366 is not a valid XML Parser resource in myTopsecretDir/XML.class.php on line 53
Warning: xml_parser_free(): 366 is not a valid XML Parser resource in myTopsecretDir/XML.class.php on line 54
But the new XML file isn't processed correctly. Instead of reading the demo2.xml the content of $xml is unchanged and returns the old values from demo1.xml as $xml->debug() shows.
So have anybody experience (and maybe solutions) for prcessing several files?
Thanks and best regard!
markus