2

I'm facing this followed issue : When i unmarshall object, xml return is look like this :

<a:root xmlns:a="urn:aaa" xmlns:b="urn:bbbb">
.....
<b:child>
    ......
</b:child>

</a:root>

instead

<root xmlns="urn:aaa">
.....
<child xmlns="urn:bbbb">
    ......
</child>

</root>

I have already tried to change my package-infos (class are on multiple packages) witch add @xmln notation with prefix="" however namespace move on other node.

@javax.xml.bind.annotation.XmlSchema(namespace = "urn:aaa", 
        elementFormDefault = XmlNsForm.QUALIFIED,
        xmlns = {
                @XmlNs(prefix="", namespaceURI="urn:aaa")
        })

package aaa

import javax.xml.bind.annotation.XmlNs;
import javax.xml.bind.annotation.XmlNsForm;

IS there an option to force jaxb for using local namespaces without prefix ?

cyvocross
  • 21
  • 2

1 Answers1

0

Your package info is okay. It works for me. Setting empty to prefix will remove prefix from xml tag.

Only difference I can see your classes are scattered into different packages as you said while mine is in same package.

Can you try to generate xml file by moving all classes in the same package where package info is defined?

arifng
  • 726
  • 1
  • 12
  • 22
  • That's very sad :(. Can you try other solution like this one: https://stackoverflow.com/a/22755785/989643 – arifng Aug 07 '19 at 15:35