on 06-23-2016 1:03 AM
Hi
Target SAP system is expecting n0: at the namepsace as shown below.
But the file from customer is coming without n0: I have a file--pi-->proxy scenario.(No mapping)
I went through lot of blogs, and tried XMLAnonymizer Bean on file adapter module. It is adding ns0: for all the elements. I just need to root node as shown in the screenshot. If add bean on SOAP adapter it has no effect.
I have tried XSLT Mapping from but it is simply adding another namespace tag at the root.
I have no control on source and target and need to change only in SAP PI/PO System. Is there a way to make this work in SAP XI/PI ?
Thanks
Ravindra
Hi Ravinda,
try this:
Create a own XSD from org. xml message with:
Free Online XSD/XML Schema Generator From XML - FreeFormatter.com
Import this as the new XSD and make with this a message mapping to your needed target format. In this case no XSLT or modul bean is needed.
Quick and dirty is also possible to make the message mapping with a xml message (source format - is an option to use an xml). I prefer solution one, but have also sceanrios which running well with the other solution.
Regards Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravindra,
I have tried XSLT Mapping from UDF to add xml namespace tag but it is simply adding another namespace tag at the root.
If you have the SAME namespace in in source and target, then you just write down the root as you want to have it and put between opening and closing tag the xsl expression xsl:copy-of select="./*". So you select all child nodes of the root.
If you have different source and target namespace you need to map each field.
Best would be if you post your source, your wished target and your xsl.
/Udo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Udo
My soure and target namespace are same and I don't have any mapping.
Expected XML
- <n0:SLL_SPL_DATA_FILE xmlns:n0="http://sap.com/xi/GTS">
</SLL_SPL_CONTROL>
</n0:SLL_SPL_DATA_FILE>
Incoming XML
<SLL_SPL_DATA_FILE xmlns="http://sap.com/xi/GTS">
<SLL_SPL_CONTROL>
</SLL_SPL_CONTROL>
<SLL_SPL_DATA_FILE>
I am using below XSL
<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:template match="/">
<ns0:SLL_SPL_DATA_FILE xmlns:ns0="http://sap.com/xi/GTS">
<xsl:copy-of select="." />
</ns0:SLL_SPL_DATA_FILE>
</xsl:template>
</xsl:stylesheet>
It is generating below output
<n0:SLL_SPL_DATA_FILE xmlns:n0="http://sap.com/xi/GTS">
<SLL_SPL_CONTROL>
<SLL_SPL_DATA_PROVIDER_ID>String 1</SLL_SPL_DATA_PROVIDER_ID>
<SLL_SPL_FILE_ID>String 2</SLL_SPL_FILE_ID>
<SLL_SPL_VRSIO>String 3</SLL_SPL_VRSIO>
<SLL_SPL_BASE_URL>http://sap.com/anyURI</SLL_SPL_BASE_URL>
</SLL_SPL_CONTROL>
<SLL_SPL_DATA_FILE>
</n0:SLL_SPL_DATA_FILE>
Basically it is putting entire xml back into root and end tag.
I need to tune XSL. Any expert in xsl who can help me ?
Thanks
Ravindra
Hi Ravindra,
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<ns0:SLL_SPL_DATA_FILE xmlns:ns0="http://sap.com/xi/GTS">
<SLL_SPL_CONTROL>
<SLL_SPL_DATA_PROVIDER_ID><xsl:value-of select="//SLL_SPL_DATA_PROVIDER_ID"/></SLL_SPL_DATA_PROVIDER_ID>
<SLL_SPL_FILE_ID><xsl:value-of select="//SLL_SPL_FILE_ID"/></SLL_SPL_FILE_ID>
<SLL_SPL_VRSIO><xsl:value-of select="//SLL_SPL_VRSIO"/></SLL_SPL_VRSIO>
<SLL_SPL_BASE_URL><xsl:value-of select="//SLL_SPL_BASE_URL"/></SLL_SPL_BASE_URL>
</SLL_SPL_CONTROL>
</ns0:SLL_SPL_DATA_FILE>
</xsl:template>
</xsl:stylesheet>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
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.