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
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]
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 the
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 perhaps
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 things
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
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
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
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 as
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
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
--
PHP
I don't really understand how the current xml namespace handling in
simplexml is useful.
test.xml:
rss version=2.0 xmlns:media=http://search.yahoo.com/mrss;
node
titleTitle1/title
titleTitle2/title
media:titleMedia Title/media:title
/node
/rss
$xml = simplexml_load_file('test.xml');
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 think this
13 matches
Mail list logo