Bonjour,

Je suis embêté car je ne suis pas très familié avec le XML, et j'ai un fichier XML à éditer. Voici ma structure du XML :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<root thumbsWidth="125" thumbsHeight="93" thumbsSpacing="2" imagesHeight="460" imagesPadding="6">
  <gallery title="Images 1" defaultImage="2" showText="true" autoPlay="true" autoPlayDelay="5">
    <image thumb="65small.jpg" src="65.jpg">
      <text>
        <![CDATA[Information à suivre...]]>
      </text>
    </image>
    <image thumb="66small.jpg" src="66.jpg">
      <text>
        <![CDATA[Information à suivre...]]>
      </text>
    </image>
    <image thumb="67small.jpg" src="67.jpg">
      <text>
        <![CDATA[Information à suivre...]]>
      </text>
    </image>
  </gallery>
  <gallery title="Images 2" defaultImage="2" showText="true" autoPlay="true" autoPlayDelay="5">
    <image thumb="65small.jpg" src="65.jpg">
      <text>
        <![CDATA[Information à suivre...]]>
      </text>
    </image>
  </gallery>
</root>
Bref, c'est un fichier XML qui permet d'alimenter une animation Flash pour un album photo. Comme vous le voyez, il peut y avoir plusieurs gallerie. Lorsque j'ajoutes une photo, je dois pouvoir ajouter une node IMAGE à la bonne gallerie (gallery). C'est là où je ne sais pas trop comment procéder. En fait, ma vrai question est comment je peux utiliser la méthode appendChild pour ajouter l'image dans à la bonne place?

Merci d'avance de vos réponses!!