Forum Discussion

Buschfunk's avatar
Buschfunk
Frequent Contributor
16 years ago

How to copy XML nodes with Groovy

Hello,

Let's assume I have the following XML as an object in a Groovy script:

<node1>
<node2>
<parameter1>Value 1</parameter1>
<parameter2>Value 2</parameter2>
<parameter3>Value 3</parameter3>
<node2>
</node1>


Is there a more or less easy way of copying all of using Groovy so that the result will be the following?

<node1>
<node2>
<parameter1>Value 1</parameter1>
<parameter2>Value 2</parameter2>
<parameter3>Value 3</parameter3>
<node2>
<node2>
<parameter1>Value 1</parameter1>
<parameter2>Value 2</parameter2>
<parameter3>Value 3</parameter3>
<node2>
</node1>


I'm really appreciating any help

Robert
No RepliesBe the first to reply