Re: Simplexml and xml namespaces

From: Date: Fri, 19 Aug 2005 15:17:46 +0000
Subject: Re: Simplexml and xml namespaces
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-18224@lists.php.net to get a copy of this message
Rasmus Lerdorf wrote:
Yeah, I agree actually. My real beef is that simplexml and var_dump() don't place nicely with each other. var_dump() ends up lumping the namespaced elements in with the non-namespaced elements of the same name, but when you iterate through things manually they are not lumped together and the only way to get at the namespaced elements is by checking for them directly with the appropriate children() call. I am fine with having to manually dereference the namespace and keeping things completely separate. I'd just like it to be easier for people to use var_dump() on a simplexml object and not have it confuse the heck out of them by showing them arrays with 2 elements in them which when they iterate only get 1 or if they call count() on it only get 1. It doesnt look difficult to make var_dump respect the namespace set by the initial sxe object for subobjects. If it were to be changed I would also suggest not returning non element type nodes as well. Right now PI, Comments, etc.. get returned by var_dump but these aren't considered sxe properties either.
Rob

« previous php.internals (#18224) next »