Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7052 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98162 invoked by uid 1010); 13 Jan 2004 15:44:03 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 98138 invoked from network); 13 Jan 2004 15:44:03 -0000 Received: from unknown (HELO miranda.org) (209.58.150.153) by pb1.pair.com with SMTP; 13 Jan 2004 15:44:03 -0000 Received: (qmail 4885 invoked by uid 546); 13 Jan 2004 15:44:00 -0000 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 13 Jan 2004 15:44:00 -0000 Date: Tue, 13 Jan 2004 10:43:59 -0500 (EST) X-X-Sender: adam@miranda.org To: Christian Schneider cc: Rob Richards , internals@lists.php.net In-Reply-To: Message-ID: References: <00fe01c3d9d1$6e8618a0$f7dea8c0@cyberware.local> <4003FEFA.2090700@cschneid.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] SimpleXML: Moving Forward From: adam@trachtenberg.com (Adam Maccabee Trachtenberg) On Tue, 13 Jan 2004, Adam Trachtenberg wrote: > Here are my thoughts on solutions: > > 1) Place all elements in an array (or nodeList) regardless whether > there's 0, 1, or many. This is the DOM solution. This just leads to > annoying code where you need to do $foo->item(0) and $foo->firstChild. > > However, I don't really see any way around this otherwise. Either it's > general or not. It can't be both. (Unless there's some magical type > that's both an array and a scalar.) I'm willing to put up with this > headache because the klunkyness here is outweighted by the niceness for > most cases. To clarify, I prefer *NOT* to put everything in an array like DOM. The headache I'm willing to put up with is the if(is_array()) code, especially if it turns out to be feasable to do the XML Schema linkage I suggested. -adam -- adam@trachtenberg.com author of o'reilly's php cookbook avoid the holiday rush, buy your copy today!