on 04-21-2015 10:42 AM
Hi Guys,
I need to replace namespace Tag in Target xml with a new value.
For Eg: My namespace Tag is - <ns0:TestHeader xmlns:ns0="http://0020.TestHeader.SS.com">
I want My target xml to have value- <ns0:TestHeader>
How can i achieve it using JAVA mapping?
Can you provide me the code to do so.
Sarjana,
Not well-formed XML is only possible by Java Mapping. Please use below replace logic in Java map.
inputContent.replaceAll("<ns0:TestHeader xmlns:ns0=\"http://0020.TestHeader.SS.com\">", "<ns0:TestHeader>");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The result would not be valid XML, so why do you want to do it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use XMLAnonymizerBean with anonymizer.acceptNamespaces parameter: Adding XMLAnonymizerBean in the Module Processor - Adding Modules to the Module Processor - SAP Libr...
Also check this blog for better understanding on usage:
- praveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thnx for your quick response.
However,I want to keep namespace prefix as it is.
I only want to replace namespace with new value as follows keeping prefix same:
<ns0:TestHeader xmlns:ns0="http://0020.TestHeader.SS.com"> to <ns0:TestHeader>
All the blogs contain info about how to remove prefix, however I am looking to replace the namespace itself with new value.
Please suggest!
User | Count |
---|---|
78 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.