I am looking to make an XSLT that will transform the input XML below:
<?xml version="1.0" encoding="UTF-8"?>
<payload>
<header>
<from>From: exmaple@domain.com</from>
<to>To: exmaple@domain.com</to>
</header>
<email>
<body>Hello, email body here...</body>
</email>
<attachments>
<attachment>
<name>log1</name>
</attachment>
<attachment>
<name>log2</name>
</attachment>
</attachments>
</payload>
into:
From: exmaple@domain.com
To: exmaple@domain.com
Hello, email body here...
To: exmaple@domain.com
log1
To: exmaple@domain.com
log2
Where the To node is repeated after every attachment. There can a number of attachments, not just two.
UPDATE FROM USER
Im pretty new to this, but i tried creating a payload without the header, email, and attachment tags. Then used to arrange them into the correct order but this looks horrible. And is not scalable
How about: