on 03-25-2010 9:14 AM
Hi Experts,
My current requirement is to pass the source structure xml in a single string in target using PI 7.1.
.I have already read blog by Michal http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2620.But [original link is broken] [original link is broken] [original link is broken],I am looking for more clarification.
Has anyone worked on this kind of requirement?
Any kind of help is appreciated.
Thanks
Nidhi
Hi Abhishek & Amit,
Thanks a lot for quick response.
I have already created 2 mappings & 1 operation mapping in which I am referring to those 2 message mappings mentioned by you.
But,while I am testing my operation mapping,it is throwing exception.
Runtime Exception when executing application mapping program com/sap/xi/tf/_MM_XSLT1_; Details: com.sap.aii.mappingtool.tf7.IllegalInstanceException; Cannot create target element /ns0:MT_XSLT_R. Values missing in queue context. Target XSD requires a value for this element, but the target-field mapping does not create one. Check whether the XML instance is valid for the source XSD, and whether the target-field mapping fulfils the requirement of the target XSD
Request you to elaborate a bit.
Thanks
Nidhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks All.....my mapping is working fine using the code above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a lot for quick response.
I am following michal's blog to do XML to string conversion .In XSLT mapping I am using following code.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://www.yourmessage.com">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
<xsl:template match="/">
<m:RequestMessage>
<m:ItemXML>
<xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[
]]
>
]]>
This code is working fine when I am doing one is to one mapping.But,I am facing problem,if I have to apply some mapping logic on source structure & then convert the XML into string.
Any idea,how can I move forward.Any help is appreciated.
Thanks
Nidhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
As suggested in the blog(which u r referring), you can create one more mapping(make it graphical one) apply ur mapping logic and then u can have that XSL mapping in which u can copy the entire structure into a xml string.
FLOW:
1) Graphical mapping( source structure - middle structure)
2) xsl mapping.(middle structure - target structure)
Thnaks
Amit
Nidhi,
I have given an example, based on the below example you manipulate the data as per ur reqmt.
http://www.flickr.com/photos/8764045@N06/4462432588/sizes/l/
http://www.flickr.com/photos/8764045@N06/4462432598/sizes/o/
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Using the return as a XML,option in Graphical mapping will give u only the the element/node choosen.
As discussed above by all, if u have structure as very small u can concatenate.. but it's not advisable.
U can do it using a single java class file.
In java code u can return the whole source XML structure as a single element, which u can use for target mapping.
For the java code, just search in forums/blogs, u will get lot of articles.
If still nt solved, do post
Babu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nidhi,
In the source mapping one option is there (return XML structure) select that and try.
otherwise you can concatenate all the sender side elements and return this ressult value to target.
If you want more info then give your source structure with occurances.
Regards
Ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
What clarification are you exactly looking for.....there are two options to do your requirement using a CDATA element in XSLT (you know it) or use a JAVA mapping.....code available in Wiki section.....if you dont find java suitable (simple) go ahead with XSLT.
Regards,
Abhishek.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.