cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT mapping - 2 messages to 1

Former Member
0 Kudos

Is it possible to map 2 xml files into 1 with only one XSLT mapping?

I need to use XSLT because the target message is a xml with only one tag of type string, and inside this string I need to pass the content of both source messages. But the only way of performing XML to string conversion is through XSLT.

I've managed to successfully perform 1 XML to string mapping, but I don't know how to proceed with 2 source xml's.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>> Is it possible to map 2 xml files into 1 with only one XSLT mapping?

in general it is but I'm not sure if it works with the XI

anyway you can try the <b>document </b>function:

http://www.mhonarc.org/archive/html/xsl-list/2005-02/msg01364.html

Regards,

michal

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

maybe you can do something like this

2 messages and 3 transformation steps

first one - map first message to string (to one tag)

second one - map second message to string (in second tag)

third one- map tag one + tab two into one target ?

this should be much easier...

Regards,

michal

henrique_pinto
Active Contributor
0 Kudos

As expected, it's kinda hard (maybe impossible? :P) to use the document() expression in XI.

And about the methods, yeah, Michal, concatenating two strings should be much easier than creating a datatype with two subnodes of the types of my source messages and than transforming to string the entire new datatype.

Thank you all for your fast replies!

MichalKrawczyk
Active Contributor
0 Kudos

no problem

thank you too

Regards,

michal

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Henrique,

Could you pls tell me in detail about how to achieve One whole xml into one string element. I am new to all this and have not used xslt or java mapping before.

Regards,

Ashish

moorthy
Active Contributor
0 Kudos

Hi,

I think, XSLT mapping will read one xml document at a time.

So if get two xmls files under one tag(root element) then you can achieve this with message/xslt/java mapping.

Then it will be of type N:1 mapping

How are you planning to do in XI.. Are you using BPM here ? so that in the fork step you can two receivers (2 files) and execute transformation steps and send with 1 message.

http://help.sap.com/saphelp_nw2004s/helpdata/en/0e/56373f7853494fe10000000a114084/content.htm

Hope this helps,

Regards,

Moorthy