Skip to Content
0
Former Member
Jul 14, 2006 at 08:05 PM

Redefining namespaces

98 Views

Hi there,

we have a request from a client to redefine the namespace of some elements inside the xml.

For example, the following XML:

<test xmlns="http://test">

<field1/>

<field2/>

<field2/>

</test>

must be sent like:

<test xmlns="http://test">

<field1/>

<field2 xmlns="http://test"/>

<field2 xmlns="http://test"/>

</test>

Is there any way to accomplish this using mapping (java or xslt) or some of the default modules? I'm using Soap receiver adapter.

PS: I've checked out that if I used different prefixes, like:

<test xmlns="http://test">

<field1/>

<ns0:field2 xmlns:ns0="http://test"/>

<ns0:field2 xmlns:ns0="http://test"/>

</test>

then it would be easy, using <xsl:copy-of> function in XSLT mapping. But the client also demands that the output message must have no prefixes (which, btw, I accomplished using XML Anonymizer Module). :/

Thanks in advance,

Henrique.