Hello all. When I do a print_r of a domelement object I get something like this:
domelement Object
(
[type] => 1
[tagname] => category
[0] => 6
[1] => 1007543104
)
What are those "0" and "1" internal variables? I can not seem to find any description
of them anywhere. What do they represent? The "0" one seems to stay constant with a
constant xml source. But the "1" one is always different though still unique. Are
these variables a php thing only? Or part of the dom specification that I missed?
Also how do I access them? I can do a "$node->tagname" or "$node->type" just fine to
get access to those internal object variables. But php does not like "$node->0" at all.
What's the problem? Some kinda of variable scoping or something?
Lastly, I don't suppose there is any way to search by these "0" variables with an
xpath_eval statement?
The problem is this: I will be receiving an xml file with all these nested "category"
elements. They only have "name" attributes, which unfortunately, I can not be guaranteed
will be unique. But I still need some unique way to identify them. Short of adding
attributes to each "category" element, I was hoping to use this "0" internal object
variable, or perhaps, the position() function from xpath. But I have no idea how to
determine an elements position when all I have is the domelement object.
Thanks for any help!
Comment