Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7442 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4760 invoked by uid 1010); 31 Jan 2004 23:48:09 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 4629 invoked from network); 31 Jan 2004 23:48:08 -0000 Received: from unknown (HELO jdi.jdimedia.nl) (212.204.192.51) by pb1.pair.com with SMTP; 31 Jan 2004 23:48:08 -0000 Received: from localhost (localhost [127.0.0.1]) by jdi.jdimedia.nl (8.12.10/8.12.10) with ESMTP id i0VNm7vs027749 for ; Sun, 1 Feb 2004 00:48:08 +0100 Date: Sun, 1 Feb 2004 00:47:17 +0100 (CET) X-X-Sender: derick@localhost To: PHP Developers Mailing List Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: SimpleXML->children() and text nodes From: derick@php.net (Derick Rethans) Hello, I was wondering on how to iterate over the elements of in the following piece of XML: foo bar foobar when I iterate over $s->body->children() I only get the and the . Shouldn't it also show the text nodes? Another thing that would be useful to have is a tag() method, so that this would work too: (ie, I can check what tag I got during iteration). body->children() as $node) { if ($node->tag() == 'element') { /* do this */ } } ?> or can I do that in a different way now? regards, Derick