I have something like this:
$x = simplexml_load_file('myxml.xml');
[...]
foreach($x->y->z[0]->w->k as $k){
[...]
}
My XML file is something like:
<x>
<y>
<z>
<w>
<k prefix:name="value">
[...]
</k>
</w>
[...]
</z>
[...]
</y>
[...]
</x>
Now, I'd like to access an attribute of my k element. I have red that I can access it using, in my foreach:
$k['prefix:name']
But it doesn't work. What I'm I doing wrong?
I added a fake attribute to my k element and it worked, I think the problem is that the attribute I'm trying to access is in a different namespace:
<k xsi:type="value">
[...]
</k>