Unfortunatly I have to work in a older web application on a PHP4 server;
It now needs to parse a lot of XML for calling webservices (custom p
I would second Rich Bradshaw's suggestion about the simpleXML backport, but if that's not an option, then xml_parse will do the job in PHP4, and still works after migration to 5.
$xml = ...; // Get your XML data
$xml_parser = xml_parser_create();
// _start_element and _end_element are two functions that determine what
// to do when opening and closing tags are found
xml_set_element_handler($xml_parser, "_start_element", "_end_element");
// How to handle each char (stripping whitespace if needs be, etc
xml_set_character_data_handler($xml_parser, "_character_data");
xml_parse($xml_parser, $xml);
There's a good tutorial here about parsing XML in PHP4 that may be of some use to you.