Hello Adam,

Monday, December 1, 2003, 6:51:38 PM, you wrote:

> On Mon, 1 Dec 2003, Stanislav Malyshev wrote:

>> AMT>> $s = simplexml_load_file('file.xml');
>> AMT>> $s->person->xsearch('/my/xpath/query');
>>
>> This makes fetch for read.

> I'm with Andi and George. We should just fix SimpleXML to return
> strings instead of objects when there are no descendant nodes.

> Then, $s->person would return an object if there were other nodes to
> examine and a string if it was the leaf.

That's a worse thing because that is really magic. So when you traverse a
xml document you have no idea what you will get. And also how do i get the
text content of an element then?

I've posted my ideas alread. Allow (string)$obj casting or provide a second
object handler that only works for printing with the __toString and we are
done. (The latter is my favorite of course).

-- 
Best regards,
 Marcus                            mailto:[EMAIL PROTECTED]

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

Reply via email to