SimpleXML end of element/tag error

From: Date: Thu, 05 Apr 2007 08:32:57 +0000
Subject: SimpleXML end of element/tag error
Groups: php.general 
Request: Send a blank email to php-general+get-252074@lists.php.net to get a copy of this message
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.

« previous php.general (#252074) next »