Bonjour,

Je souhaiterais copier un element vers un autre element.

Document Entrée :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
<Request>
<Head>
<Authentification>
    <Login></Login>
    <password></password>
</Authentification>
<CodeService></CodeService>
<Service></Service>
<Operation></Operation>
</Head>
</Request>
Nouveau Document pour sortie :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
<Response>
<Head>
<CodeService></CodeService>
</Head>
</Response>
Je voudrais prendre l'element codeservice du premier pour le mettre dans le 2nd (element response)

Le problement est le suivant :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
 
org.jdom.IllegalAddException: The element "CodeService" could not be added as a child of "Head": The element already has an existing parent "Head"
Comment copier un element sans garder le parent ?