Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12454 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45106 invoked by uid 1010); 29 Aug 2004 02:21:04 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 37786 invoked from network); 29 Aug 2004 02:18:31 -0000 Received: from unknown (HELO rounoff.darktech.org) (66.11.160.117) by pb1.pair.com with SMTP; 29 Aug 2004 02:18:31 -0000 Received: from outoforder.argon.net ([10.10.10.5]) by rounoff.darktech.org with esmtp (Exim 3.35 #1 (Debian)) id 1C1FH4-0003XA-00 for ; Sat, 28 Aug 2004 22:18:30 -0400 Message-ID: <41313CF1.3000706@argontechnologies.ca> Date: Sat, 28 Aug 2004 22:18:25 -0400 User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803) X-Accept-Language: en MIME-Version: 1.0 To: internals@lists.php.net X-Enigmail-Version: 0.85.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: SimpleXMLIterator From: mathieu.bruneau@argontechnologies.ca (Mathieu Bruneau) Hi all, I have been playing with the SPL lately and today I ended up playing with the SimpleXMLIterator. The documentation on that class if fairly poor and I'm in fact requesting some information about it. I managed to create a SimpleXMLIterator passing it basic xml in the constructor but wasn't able to get anything from the getChildren() method and hasChildren() return false. The var_dump of the iterator show me the expected thing tough. Nor does the current() or key() return anything. I'm using php5.0.1 Example: Here we areThere"; $it = new SimpleXMLIterator($xml); var_dump($it); while($it->hasChildren()) { echo "While\n"; $child = $it->getChildren(); } echo "Begin\n"; echo "Key : ".$it->key()."\n"; echo "Current :".$it->current()."\n"; echo "End\n"; ?> And here's what is outputted object(SimpleXMLIterator)#1 (2) { ["test1"]=> string(11) "Here we are" ["test2"]=> string(5) "There" } Begin Key : Current : End I tried with some other combination of possible xml but nothing worked so far. Any things I'm doing wrong ? -- Math aka ROunofF ====== argontechnologies.ca