cancel
Showing results for 
Search instead for 
Did you mean: 

REG : Can we change namespace using any adapter module.

Former Member
0 Kudos

Hi All,

I was working on the XMLAnonymizerBean adapter module. his module provides us the functinality of changing the prefix of namespace and selecting sprecified modules in the output XML. Now i am stuck with a question ie is there any module that can change the namespace in the output xml. for example :

xmnls : namespace1 to

xmnls : namespace 2.

Accepted Solutions (0)

Answers (3)

Answers (3)

Shabarish_Nair
Active Contributor
0 Kudos

dont think the XMLAnonymizerBean will help in this case.

you will have to go for a java or xslt mapping after the actual data mapping that will just do that feature for you.

a custom adapter module is also an option.

former_member200962
Active Contributor
0 Kudos
I was working on the XMLAnonymizerBean adapter module.
Now i am stuck with a question ie is there any module that can change the namespace in the output xml. for example :

Did you check Stefan's blog for this: /people/stefan.grube/blog/2007/02/02/remove-namespace-prefix-or-change-xml-encoding-with-the-xmlanonymizerbean

From the above blog:
You can use the bean for changing the default namespace to a requested one, which is obligatory in some rare scenarios, like 
pidx.
Example: http://namespace1 '' http://namespace2 ns

Regards,

Abhishek.

former_member187339
Active Contributor
0 Kudos

Hi,

You can use XMLAnonymizerBean one more time else XSLT mapping.

can you provide your target structure and the structure which you are getting after XMLAnonymizerBean

Regards

Sruaj

Edited by: S.R.Suraj on Oct 5, 2009 2:05 AM

Former Member
0 Kudos

Hi suraj,

Sorry i couldn't get your logic. can you please explain me much more in deatil.

Thanks in advance,

Siva

former_member187339
Active Contributor
0 Kudos

Hi Sivaram,

Can you provide the final target structure (which you are expecting) and the structure which you are getting after XMLAnonymizerBean, for more information on the problem

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

Consider I have a ouput xml which is the input module as below:

Input to Module:

<Test xmlns:foo="urn:foo">

<foo:Bar>

<value>10</value>

</foo:Bar>

</Test>

I want the finalised structure as below:

Output of module:

<Test xmlns:foo="urn:foo123">

<foo:Bar>

<value>10</value>

</foo:Bar>

</Test>

Can please heip me out in this.

Thanks in adavance,

Siva

Former Member
0 Kudos

Did you tried using XML anonymizer bean at the receiver adapter channel module for changing the namespace

Otherwise best option is use the XSLT mapping as suggested by the suraj...

1.Implement your mapping logic done in message mapping and import the same in imported archiving and provide the same in interface mappings...

2.otherwise just created your message mapping as usual and use XSLT mapping as second mapping in your interface mapping just for changing the namespace...

second option is simpler as no need to touch the message mapping...

HTH

Rajesh

former_member187339
Active Contributor
0 Kudos

Hi,

You can use a simple XSLT mapping in Receiver adapter . check this blog

http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=%28J2EE3417100%29ID0975923150DB0123415523184199414...

Provide the actual namespace in the bleow code


<?xml version='1.0' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:p2="provideyournamespace">
	<xsl:template match="/">	
                   <xsl:copy-of select="*"/>
	</xsl:template>
</xsl:stylesheet>

Regards

Suraj