on 01-07-2015 9:07 AM
Hi Folks,
Can anybody help me how to resolve the below requirement.
business requirement Is: in which client wants the complete input xml in one field at target side i.e., to return the input payload as an XML into a single field
for that we assumed XSLT Mapping is the correct. since i am new to XSLT mapping . i gone through the below URL also since i am unable to get the code.
below is the screen shot :
if some one provide me XSLT code for above requirement that is a great help from your side.
Thanks in Advance
Hari
Hi Hari
I think you can achieve this with graphical mapping. Map your target filed with the root node of your input xml.
right click on the root node and select the option 'Return as xml'.
Thanks,
Indrajit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hari,
I think with an UDF you can't do it. You should do it with Java mapping or XSLT. With XSL you can do the next example:
Source XML:
<?xml version="1.0" encoding="UTF-8"?>
<test>
<item1>1</item1>
<item2>2</item2>
<item3>3</item3>
</test>
XSL:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:element name="root" namespace="http://test">
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
<xsl:copy-of select="/"/>
<xsl:text disable-output-escaping="yes">]]></xsl:text>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Output XML:
<?xml version="1.0" encoding="UTF-8"?>
<root xmlns="http://test"><![CDATA[<test><item1>1</item1><item2>2</item2><item3>3</item3></test>]]></root>
You can change the namespaces and the tags in the XSL that i provided the example. Pay attention to the xsl:element tag.
Hope this helps.
Regards.
Hi Hari
Check this. It may help you. Go for the java mapping
Whole Payload to a XML field - Process Integration - SCN Wiki
Thanks,
Indrajit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If the source structure is not having so many fields then you can simply use CONCAT function or write simple UDF to generate single line output to target field.
Regards,
Sarvesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.