cancel
Showing results for 
Search instead for 
Did you mean: 

Changing prefix from ns0 to ns

Former Member
0 Kudos

Hello,

I have to change the prefix from my message mapping from ns0 to ns, in other words from this:

- <ns0:PurchaseOrderRequest xmlns:ns0="http://sap.com/xi/SAPGlobal/Global">

to this:

<n0:PurchaseOrderRequest xmlns:n0="http://sap.com/xi/SAPGlobal/Global"

And please don't ask me why. That's a long story

I'm aware of the XMLAnonymizerBean, but this is not an option since HTTP adapter is used.

I have also tried the following xsl, but this one removes the prefix completely:

<?xml version="1.0"; encoding="UTF-8"?> 
<ns0:stylesheet version="1.0"; xmlns:ns0="http://www.w3.org/1999/XSL/Transform"> 
   <ns0:output method="xml" encoding="UTF-8"/> 
   <ns0:template match="/"> 
      <ns0:copy> 
         <ns0:apply-templates/> 
      </ns0:copy> 
   </ns0:template> 
   <ns0:template match="*"> 
      <ns0:element name="{local-name()}"> 
         <ns0:apply-templates select="@* | node()"/> 
      </ns0:element> 
   </ns0:template> 
   <ns0:template match="@*"> 
      <ns0:attribute name="{local-name()}"> 
         <ns0:value-of select="."/> 
      </ns0:attribute> 
   </ns0:template> 
   <ns0:template match="text() | processing-instruction() | comment()"> 
      <ns0:copy/> 
   </ns0:template> 
</ns0:stylesheet>

Anyone who has done something similar to this?

Thanks,

Per

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Per,

If the desired prefix change is to be delivered to the target system after transformation you can also use module in your receiver channel and can use the replace string in the module. Always better to use the dynamic parameter code in your module and can take the input from Module Configuration against your module parameter name.

Thanks & Regards,

Abhi

Former Member
0 Kudos

Hi Per,

i had a similar situation and i used Java mapping with replace function to replace the namespace to the desired value.

Thanks,

Venkatesh