Im struggling to find a solution for this problem because i end up in a recursive loop.
XML Source Example:
<runtime xmlns="http://xxx/v1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="xxx.xsd">
<messages>
<message>
<severity>debug</severity>
<source>Client</source>
<subject>Subject</subject>
<body>Body</body>
</message>
</messages>
And i need to put the Messages element inside itself in the body element
<runtime xmlns="http://xxx/v1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="xxx.xsd">
<messages>
<message>
<severity>debug</severity>
<source>Client</source>
<subject>Subject</subject>
<body>
<messages>
<message>
<severity>debug</severity>
<source>Client</source>
<subject>Subject</subject>
<body>Body</body>
</message>
</messages>
</body>
</message>
</messages>
I can not come up with a working solution without ending up in loop error. Any help aprriciated.
You have to run a copy template except for the
<body>element. For this special tag, make another copy template with a name to drive the transformation from your new start and use another path in ordrer to avoid the loop.Classic copy template execpt for body
For the body element, start copying from the beginning by assigning another path (with the mode)
And copy the tags into the body element with another copy template
As a result :