I am trying to create an XML representation of objects without the namespace prefixes using JAXB. I would like to have my objects marshalled to look similar to the following:
<test xmlns="namespace1">
<field1>
<field2 xmlns="namespace2">
...
</field2>
</field1>
</test>
Unfortunately, I need it formatted this way rather than using prefixes and a root declaration of the namespaces because the server I am connecting to refuses any other formats. I have tried several different things to get JAXB to marshal my objects this way, but I haven't had any success. Is this possible with JAXB?
EDIT: I am not trying to remove all namespace declarations. I at least need a namespace declaration on the child element with no prefixes in order for this to work.