How to remove namespace prefix from xml?
Issue
- I have JAXB objects created from a schema. After one of the processor in camel route, while marshalling, the xml elements are getting annotated with ns3/ns4. I have tried marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, ""), but this is option is not useful. I cannot modify my schema or change package-info.java.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns4:SubmitDocument xmlns:ns2="http://www.w3.org/2000/09/xmldsig#">
<ns4:Message>
<ns4:SubmitRequest>
<ns3:NSDGMessage>
<ns3:EnvelopeVersion>1.0</ns3:EnvelopeVersion>
<ns3:Header>
<ns3:MessageDetails>
<ns3:Class>http://192.168.10.41/02138e54889949f0b9c4e31a7febd8af</ns3:Class>
<ns3:Qualifier>request</ns3:Qualifier>
<ns3:Function>submit</ns3:Function>
<ns3:TransactionID></ns3:TransactionID>
<ns3:CorrelationID></ns3:CorrelationID>
<ns3:Transformation>XML</ns3:Transformation>
<ns3:ResponseMode>asynchronous</ns3:ResponseMode>
<ns3:NSDGTest>0</ns3:NSDGTest>
<ns3:NSDGTimestamp>2015-01-12T17:15:43.988+05:30</ns3:NSDGTimestamp>
</ns3:MessageDetails>
.
.
.
- How do I remove these namespace profix?
Environment
- Red Hat JBoss Fuse
- 6.2.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
