Ajout d'un attribut sur un noeud xml
Bonjour,
j'ai un document xml dans un morceau de code vbscript.
J'aimerais dans certains noeud ajouter un attribut, seulement je ne vois pas trop comment faire
Mon doc xml est le suivant
Code:
1 2 3 4 5
|
<data>
<compte idcompte="1" libcompte="libelle1"/>
<compte idcompte="2" libcompte="libelle2"/>
</data> |
j'aimerais y ajouter un autre attribut : idfiche="1"
J'ai testé cela mais ça ne marche pas (Itarget ets mon doc xml)
Code:
1 2 3 4 5 6
|
if Itarget.childNodes.length > 0 then
for each elt in Itarget.childNodes
elt.setattribute "idfiche", IdFiche
next
end if |
Auriez-vous une idée?
Merci d'avance