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

-- 
[EMAIL PROTECTED]
author of o'reilly's php cookbook
avoid the holiday rush, buy your copy today!

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to