I put your XML into a file called TEST.XML (after fixing a small error where you left out "AN " before the first answer.
Then I ran it through the following code that I had written Previously:
<?php
global $xmldata;
global $i;
$xmldata = array();
$i = 0;
function startElementHandler($parser, $name, $attribs) {
global $xmldata;
global $i;
$xmldata["$name"]["$i"] = $attribs;
$i++;
}
function endElementHandler($parser, $name) {
}
function cdataHandler($parser, $data) {
}
$parser = xml_parser_create();
xml_set_element_handler($parser, "startElementHandler", "endElementHandler");
xml_set_character_data_handler($parser, "cdataHandler");
$file="TEST.XML";
if (!($fp = fopen($file, "r"))) {
die("could not open file for reading!");
}
while ($data = fread($fp, 4096)) {
if (!xml_parse($parser, $data, feof($fp))) {
die(sprintf("XML error %d %d", xml_get_current_line_number($parser), xml_get_current_column_number($parser)));
}
}
echo "<b>\n<pre>\n";
print_r($xmldata);
echo "<b>\n</pre>\n";
?>
This will create a variable called $xmldata where you should be able to access the data you are looking for. Let me know if there is anything else I can do to help.
www.netlobo.com