on 06-09-2015 2:59 PM
Hi All,
Im trying to achieve the following transformation by using XSL mapping:
Input
<ROOTNODE>
<NODEPARAMETERS>
<USER>ABC</USER>
<PASSWORD>DEF</PASSWORD>
<REQUESTID>12321</REQUESTID>
</NODEPARAMETERS>
<NODEMESSAGE>
<DESTINATION>453453453</DESTINATION>
<TEXT>TESTING</TEXT>
<SOURCE>31232</SOURCE>
</NODEMESSAGE>
</ROOTNODE>
Output
USER=ABC&PASSWORD=DEF&REQUESTID=12321
<NODEMESSAGE>
<DESTINATION>453453453</DESTINATION>
<TEXT>TESTING</TEXT>
<SOURCE>31232</SOURCE>
</NODEMESSAGE>
Basically, im trying to output the node parameters as string and node message as XML in a single output.
Is this possible via XSL mapping?
If so, how is it done?
Regards,
J
Hi all,
In my source XML, i have 2 nodes as follows:
<ROOTNODE>
<NODEPARAMETERS>
<USER>ABC</USER>
<PASSWORD>DEF</PASSWORD>
<REQUESTID>12321</REQUESTID>
</NODEPARAMETERS>
<NODEMESSAGE>
<DESTINATION>453453453</DESTINATION>
<TEXT>TESTING</TEXT>
<SOURCE>31232</SOURCE>
</NODEMESSAGE>
</ROOTNODE>
For the target, im expecting that the Nodeparameters should appear as text/string without <> tags, and concatenated by & character; followed by the node message to appear as xml
so ideally the output should be somewhat like this:
USER=ABC&PASSWORD=DEF&REQUESTID=12321
<NODEMESSAGE>
<DESTINATION>453453453</DESTINATION>
<TEXT>TESTING</TEXT>
<SOURCE>31232</SOURCE>
</NODEMESSAGE>
Is this possible through XSL mapping/ Java mapping? or a combination of both?
Any pointers to the java code?
I assume i can have both XSL and java mapping in the operation mapping....
Regards,
J
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Janan,
Please use Java Mapping. Please follow example shown in How to create Java Mapping in SAP PI / PO
add this logic to get user name and password from input content.
input.substring(input.indexOf("<USER>")+6, input.indexOf("</USER>"))
input.substring(input.indexOf("<PASSWORD>")+10, input.indexOf("</PASSWORD>"))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Janan,
XSLT can output text or XML or html. Not combinations.
Please use Java mapping.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.