Re: SimpleXML end of element/tag error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



And with :

foreach ($xml as $cs) {
.....
}
??

jm

----- Original Message ----- From: "Don Don" <progwihz@xxxxxxxxx>
To: "PHP List" <php-general@xxxxxxxxxxxxx>
Sent: Thursday, April 05, 2007 10:32 AM
Subject:  SimpleXML end of element/tag error


I am using simple xml to parse an xml file, the program parses the file and produces an error at the end of the foreach loop when it reaches the end of the tag, it tries to look for an element/tag when there is none and produces an error "Call to a member function attributes() on a non-object" the foreach loop looks like this

 foreach($xml->CS as $CS)
{
//processing takes place here
}

 when there are no more CS it fires an error

How can i detect when there are no more elements/tags to parse and handle it?


cheers


---------------------------------
It's here! Your new message!
Get new email alerts with the free Yahoo! Toolbar.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux