Re: Simplexml and xml namespaces
| From: | Sterling Hughes | Date: | Fri, 19 Aug 2005 19:04:06 +0000 |
| Subject: | Re: Simplexml and xml namespaces | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-18227@lists.php.net to get a copy of this message | ||
I agree. var_dump() should accurately expose the structure of the
simplexml object, if people want to see *everything* they should dump
it explicitly (there is a method in the DOM api to do this?)
-Sterling
On 8/19/05, Rob Richards <rrichards@ctindustries.net> wrote:
> 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
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>