Re: [PHP-DEV] Simplexml and xml namespaces

2005-08-23 Thread Marcus Boerger
Hello Rob, what we need here is a temp hash table to store the names. var_dump would grep them through get_properties... Friday, August 19, 2005, 9:34:54 PM, you wrote: > There isn't a single method in DOM for this - have to write code to do > it. get_properties was not implemented in DOM due

Re: [PHP-DEV] Simplexml and xml namespaces

2005-08-19 Thread etnu
This is my first post here, so forgive me if I'm not doing this right. It seems like php objects need a magic function __dump or __debug or something similiar to handle these kinds of situations. I can see why this might be construed as hackish / lame, but by that token, var_dump itself is. It see

Re: [PHP-DEV] Simplexml and xml namespaces

2005-08-19 Thread Rasmus Lerdorf
john wrote: > Long time reader, first time poster. > > Rasmus, I noticed your var_dump says $x->node->title is of string(6) ... > though I count only 5. Just wondering, a simple typo or something more > involved? That was just me munging the output a bit. It gets the right length. -Rasmus --

Re: [PHP-DEV] Simplexml and xml namespaces

2005-08-19 Thread Rob Richards
There isn't a single method in DOM for this - have to write code to do it. get_properties was not implemented in DOM due to too many properties and many properties recursive (DOM both ascends and descends a tree). Any debugging would be useless trying to sort through all the crap. I, like Adam,

Re: [PHP-DEV] Simplexml and xml namespaces

2005-08-19 Thread Adam Maccabee Trachtenberg
On Fri, 19 Aug 2005, Sterling Hughes wrote: > 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?) You mean other than reserializing the data back a

Re: [PHP-DEV] Simplexml and xml namespaces

2005-08-19 Thread Sterling Hughes
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 <[EMAIL PROTECTED]> wrote: > Rasmus Lerdorf wrote: > > >Yeah, I

Re: [PHP-DEV] Simplexml and xml namespaces

2005-08-19 Thread john
Long time reader, first time poster. Rasmus, I noticed your var_dump says $x->node->title is of string(6) ... though I count only 5. Just wondering, a simple typo or something more involved? Regards, John Rasmus Lerdorf wrote: Sterling Hughes wrote: Hm - that shouldn't be. I think the

Re: [PHP-DEV] Simplexml and xml namespaces

2005-08-19 Thread Rob Richards
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 lum

Re: [PHP-DEV] Simplexml and xml namespaces

2005-08-19 Thread Adam Maccabee Trachtenberg
On Fri, 19 Aug 2005, 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 thing

Re: [PHP-DEV] Simplexml and xml namespaces

2005-08-19 Thread Rasmus Lerdorf
Adam Maccabee Trachtenberg wrote: > On Thu, 18 Aug 2005, Rasmus Lerdorf wrote: > > >>But how does this really help? I don't see how it is possible to >>distinguish the namespaced title vs. the non-namespaced ones. My >>suggestion here would be that for namespaced nodes the namespace alias >>(or

Re: [PHP-DEV] Simplexml and xml namespaces

2005-08-19 Thread Adam Maccabee Trachtenberg
On Thu, 18 Aug 2005, Rasmus Lerdorf wrote: > But how does this really help? I don't see how it is possible to > distinguish the namespaced title vs. the non-namespaced ones. My > suggestion here would be that for namespaced nodes the namespace alias > (or perhaps the actual namespace?) becomes t

Re: [PHP-DEV] Simplexml and xml namespaces

2005-08-18 Thread Rasmus Lerdorf
Sterling Hughes wrote: > Hm - that shouldn't be. > > I think the right solution is that media:title should not show up in > the children of node, unless you are looking at the proper namespace, > ie, you need to use children() to get the children in that namespace. Ah, you are right. It's the

Re: [PHP-DEV] Simplexml and xml namespaces

2005-08-18 Thread Sterling Hughes
Hm - that shouldn't be. I think the right solution is that media:title should not show up in the children of node, unless you are looking at the proper namespace, ie, you need to use children() to get the children in that namespace. -Sterling On 8/18/05, Rasmus Lerdorf <[EMAIL PROTECTED]> wrot

Re: [PHP-DEV] Simplexml and xml namespaces

2005-08-18 Thread George Schlossnagle
On Aug 18, 2005, at 10:43 PM, Rasmus Lerdorf wrote: Or, alternatively, have a separate arrays: ["title"]=> array(2) { [0] => string(6) "Title1" [1] => string(6) "Title2" } ["media:title"]=>string(11) "Media Title" The latter is actually what I was (naiively) expecting. I thi

[PHP-DEV] Simplexml and xml namespaces

2005-08-18 Thread Rasmus Lerdorf
I don't really understand how the current xml namespace handling in simplexml is useful. test.xml: http://search.yahoo.com/mrss";> Title1 Title2 Media Title $xml = simplexml_load_file('test.xml'); $xml->node ends up containing a title array that looks like this: ["title"]=> array