Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:18220 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53161 invoked by uid 1010); 19 Aug 2005 06:59:14 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 53146 invoked from network); 19 Aug 2005 06:59:14 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Aug 2005 06:59:14 -0000 X-Host-Fingerprint: 204.11.219.139 lerdorf.com Linux 2.4/2.6 Received: from ([204.11.219.139:53429] helo=colo.lerdorf.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id A7/3D-33075-04385034 for ; Fri, 19 Aug 2005 02:59:13 -0400 Received: from [192.168.200.106] (c-24-6-1-160.hsd1.ca.comcast.net [24.6.1.160]) (authenticated bits=0) by colo.lerdorf.com (8.13.4/8.13.4/Debian-3) with ESMTP id j7J6x6ei003294 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 18 Aug 2005 23:59:08 -0700 Message-ID: <4305833A.5070407@lerdorf.com> Date: Thu, 18 Aug 2005 23:59:06 -0700 User-Agent: Mozilla Thunderbird 1.0.6 (Macintosh/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: sterling@apache.org CC: internals@lists.php.net References: <43054765.3000208@lerdorf.com> <24e5f3b705081823422adb289c@mail.gmail.com> In-Reply-To: <24e5f3b705081823422adb289c@mail.gmail.com> X-Enigmail-Version: 0.92.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Simplexml and xml namespaces From: rasmus@lerdorf.com (Rasmus Lerdorf) Sterling Hughes wrote: > Hm - that shouldn't be. > > I think the right solution is that media:title should not show up in > the children of node, unless you are looking at the proper namespace, > ie, you need to use children() to get the children in that namespace. Ah, you are right. It's the damn var_dump() problem again. eg. $xml = << Title Media Title EOF; $x = simplexml_load_string($xml); var_dump($x->node) shows: object(SimpleXMLElement)#2 (1) { ["title"]=> array(2) { [0]=> string(6) "Title" [1]=> string(11) "Media Title" } } but var_dump($x->node->title) shows: object(SimpleXMLElement)#4 (1) { [0]=> string(6) "Title" } There should be a simplexml_dump() or something along those lines and perhaps even a warning in var_dump() when it tries to dump an object that has its own iterator. -Rasmus