That's also the issue I am facing. Thanks Colin for this brief and precise
summary. I just want to add that in my project it is not just for
convenience or performance reasons.
I have a schema A which imports schema B and extends type definitions from
B. Even if I set up the JAXBContext just with schema A (by passing only its
package name to the newInstance method), also the namespace of B is
automatically declared on every instance document that I unmarshal. However,
if there is no content of B in my document I would like the namespace
declaration to be skipped.
Von: Colin Fleming [mailto:colin.mailinglist@...]
Gesendet: Mittwoch, 19. November 2008 09:28
An: users@... Betreff: Re: AW: AW: Duplicated namespace declaration from output xml
The problem that we had with the prefix mapper was that it doesn't allow you
to remove the namespaces that JAXB declares automatically (i.e. the ones
statically known by the JAXBContext). For performance (and convenience)
reasons we create a single JAXBContext that's aware of many different
document types, and JAXB ends up adding about 60 namespace declarations to
each document. The prefix mapper doesn't help with that.