I'm facing an Xml problem. Probably something stupid but I can't see it...
Here is my Xml at start :
<combinations nodeType="combination" api="combinations">
<combination xlink:href="http://localhost:8888/vmv/ps/api/combinations/1">
<id><![CDATA[1]]></id>
</combination>
<combination xlink:href="http://localhost:8888/vmv/ps/api/combinations/2">
<id><![CDATA[2]]></id>
</combination>
</combinations>
So for each node, I make the API call then I want to replace the node by the returned value, like that :
$c_index = 0;
foreach($combinations->combination as $c){
$new = apiCall($c->id); //load the new content
$combinations->combination[$c_index] = $new;
$c_index++;
}
If I dump the $new into the foreach, I got an simplexmlobject which is fine but if I dump the $combinations->combination[$x], I've got big string of blank...
I'd like to get :
<combinations nodeType="combination" api="combinations">
<combination xlink:href="http://localhost:8888/vmv/ps/api/combinations/1">
<my new tree>
....
</my new tree>
</combination>
<combination xlink:href="http://localhost:8888/vmv/ps/api/combinations/2">
<my new tree>
....
</my new tree>
</combination>
</combinations>
I must be missing something but what...? That's the question...
thanks for your help !