simplexml question

Hi

Sorry if this is not the right newsgroup to ask this question but I am
having a problem with simplexml in PHP5.

This is the code I have

$xml = [at] simplexml_load_file('xmlfile') or die;

foreach ($xml->result->phrase as $phrase) {
printf("Title %s\n", $phrase->title);
printf("Url %s\n", $phrase->url);
printf("Desc %s\n", $phrase->desc);
printf("Review-url %s\n", $phrase->reviewurl);
}

foreach ($xml->result->domain->domain-listing->store-offers->store-o ffer as
$storeoffer) {
printf("Store Name %s\n", $storeoffer->store-name);
printf("Store Logo %s\n", $storeoffer->store-logo);
printf("In Stock %s\n", $storeoffer->in-stock);
printf("Offer Price %s\n", $storeoffer->offer-price);
printf("Tax %s\n", $storeoffer->tax);
printf("Shipping %s\n", $storeoffer->shipping);
printf("Total Price %s\n", $storeoffer->total-price);
printf("Offer Url %s\n", $storeoffer->offer-url);
printf("Store Rating %s\n", $storeoffer->store-rating);
printf("Store Rating Image %s\n", $storeoffer->store-rating-image);
printf("Num Store Reviews %s\n", $storeoffer->num-store-reviews);
printf("Store Review Url %s\n", $storeoffer->store-review-url);

}

When I try to process this I get an error on this line foreach
($xml->result->domain->domain-listing->store-offers->store-o ffer as
$storeoffer) {

the error is

Parse error: parse error, unexpected T_OBJECT_OPERATOR in
/home/findmeth/public_html/uknetholidays/index.php on line 17

I think the error is being caused by the store-offers element as when I
remove this I dont get the error

Any ideas?

I cant change the structure of the xml file as it is supplied by a third
party

Thanks in anticipation

Keith
http://www.mylistforsanta.com
MyListforSanta [ Mo, 20 Dezember 2004 18:50 ] [ ID #546000 ]
PHP » alt.php.sql » simplexml question

Vorheriges Thema: newbie join problem...
Nächstes Thema: Unique Order ID's high volume site HELP