Xml via php

niou142 -  
 niou142 -
bonjour,
Je suis en train de céer un fichier xml via du php.
Je voudrais créer cela:

<labels>
<label>
<x>0</x>
<y>25</y>
</label>
</labels>

J'arrive a créer <labels> les x et y mais pas <label>.comment faire ?
voici mon code :
$officeNode = $root->new_child("labels", "");
$stockNode1 = $officeNode->new_child("x", "" );
$stockNode2 = $officeNode->new_child("y", "" );
Comment ajouter <label> ,quel est la syntaxe svp?

Merci
A voir également:

2 réponses

Utilisateur anonyme
 
bonjour

$officeNode = $root->new_child("labels", "");
$stockNode0 = $officeNode->new_child("label", "" );
$stockNode1 =$stockNode0->new_child("x", "" );
$stockNode2 = $stockNode0->new_child("y", "" ); 
0
niou142
 
Je te remercie pour ton aide
0