cancel
Showing results for 
Search instead for 
Did you mean: 

add dynamic namespace declaration into xml root element

jean-philippe_pain2
Participant
0 Kudos

Hello all,

i've have two scenarios (mail to mail and file to file) with the same issue : no namespace in my XML file and i have to create one 'dynamically' from XML values.

Example :

<root>

<name>test</name>

<email>test</email>

<schema>schemaID</schema>

</root>

Now I want to add infos into the root element for namespace declaration and so on, without expansion of the xsd. I've must use the value from the field schemaID.

Example:

<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns: namespace="http://test.de/schemaID">

<name>test</name>

<email>test</email>

</root>

I've already done it before through XSLT but it wasn't dynamic !! I don't know how to do it in XSL and i am not a java expert.

Someone got an idea ?

Thanks,

Jean-Philippe.

Accepted Solutions (0)

Answers (1)

Answers (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

If you want to add name space at mapping level two options

1)Using XSLT Mapping ,its very easy,google it to get sample XSLT code ,it will solve your problem.

2)Using java mapping,in java mapping use regular expression code ,using regex(Regulkar expresion)we can add any content in message at any level.

Regards,

Raj

jean-philippe_pain2
Participant
0 Kudos

Done in java mappping.