Skip to Content
0
Former Member
Jan 17, 2014 at 07:24 PM

Help Required on XSLT Mapping

210 Views

Hi Folks,

I need some help on XSLT mapping as I am very new to it. I have attached a source and target file. I need inputs on XSLT mapping in order to achieve the Target message from the Source.

Source

xml version="1.0" encoding="UTF-8"?>

ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">

<ns0:Message1>

<ns1:PayloadDescriptor xmlns:ns1="http://Softel.com/xi/Softel_SC_PLANNING/GPEO/TransactionalData">

<MessageFormat>owner=&quot;Softel&quot;;version=1.0;date=&quot;October 2013&quot;;</MessageFormat>

<SenderId>Softel-GPEO</SenderId><RecipientId>SoftelCorp</RecipientId>

<ControlNumber>0000000001</ControlNumber>

<MessageId>A123-B123-C123-D123</MessageId>

<DocumentType>SoftelOrders</DocumentType>

<DateSent format="yyMMDDhhmmss" timezone="UTC">20140117000001</DateSent>

<PayloadType>Text/Plain</PayloadType>

<Version>1.0</Version>

</ns1:PayloadDescriptor>

</ns0:Message1>

<ns0:Message2>

<AttachmentDescriptor>

<DocumentType>SoftelOrders</DocumentType>

<Version>1.0</Version>

<Date format="yyMMDDhhmmss" timezone="UTC">20140117000001</Date>

<Attachments count="">

<Attachment>

<FileData>

<Include href="A123-B123-C123-D123">

</Include>

</FileData>

<FileName>Sample.txt</FileName>

<FileType>Text</FileType>

<FileCreateDate format="yyMMDDhhmmss" timezone="UTC">20140117000001</FileCreateDate>

<FileSize uom="byte">100</FileSize></Attachment>

</Attachments>

</AttachmentDescriptor>

</ns0:Message2>

</ns0:Messages>

Target Message

<?xml version="1.0" encoding="UTF-8"?>

<ns0:stylesheet version="1.0" xmlns:ns0="http://www.w3.org/1999/XSL/Transform" xmlns:a="http://Softel.com/xi/Softel_SC_PLANNING/GPEO/TransactionalData">

<ns0:template match="/">

<ns1:Envelope xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">

<ns1:Header>

<PayloadDescriptor>

<MessageFormat>&quot;Softel&quot;;version=1.0;date=&quot;October 2013&quot;;</MessageFormat>

<SenderId>Softel-GPEO</SenderId>

<RecipientId>SoftelCORP</RecipientId>

<ControlNumber>0000000001</ControlNumber>

<MessageId>A123-B123-C123-D123</MessageId>

<DocumentType>SoftelOrders</DocumentType>

<DateSent format="yyMMDDhhmmss" timezone="UTC">20140117000001</DateSent>

<PayloadType>Text</PayloadType>

<Version>1.0</Version>

</PayloadDescriptor>

</ns1:Header>

<ns1:Body>

<AttachmentDescriptor>

<DocumentType desc="" valueDesc="">SoftelOrders</DocumentType>

<Version desc="" valueDesc="">1.0</Version>

<Date desc="" valueDesc="" format="" timezone="">20140117000001</Date>

<Attachments count="1">

<Attachment>

<FileData>

<Include href="A123-B123-C123-D123"/>

</FileData>

<FileName>Sample.txt</FileName>

<FileType desc="" valueDesc="">Text</FileType>

<FileCreateDate desc="" valueDesc="" format="" timezone="">20140117000001</FileCreateDate>

<FileSize desc="" valueDesc="" uom="byte">100</FileSize>

</Attachment>

</Attachments>

</AttachmentDescriptor>

</ns1:Body>

</ns1:Envelope>

</ns0:template>

</ns0:stylesheet>

Attachments

Target_File.xml (2.1 kB)
Source_File.Xml (1.5 kB)