i have a requirement two combine two similar xml responses into one xml payload. Here, i stored one xml into flowVar and other is in payload. Im trying with XSLT but not getting it. Below is the sample xml responses.
Response1 :
<root>
<token>hhd</token>
<type>xyz</type>
<statement>
<id>1</id>
<name>sri</name>
</statement>
<statement>
<id>2</id>
<name>jay</name>
</statement>
<root>
Response2:
<root>
<token>hhd</token>
<type>xyz</type>
<statement>
<id>3</id>
<name>paul</name>
</statement>
<statement>
<id>4</id>
<name>nick</name>
</statement>
<root>
In above two similar responses, i have to add 2nd response statement tags to 1st xml response.Here all tags are same in both xmls except statement tag. Im using XSLT and unable to do it.
Output:
<root>
<token>hhd</token>
<type>xyz</type>
<statement>
<id>1</id>
<name>sri</name>
</statement>
<statement>
<id>2</id>
<name>jay</name>
</statement>
<statement>
<id>3</id>
<name>paul</name>
</statement>
<statement>
<id>4</id>
<name>nick</name>
</statement>
<root>
Is there any alternative way to do it like with dataweave. Thanks.