users@jaxb.java.net

AW: AW: AW: Duplicated namespace declaration from output xml

From: Claus Nagel <claus.nagel_at_gmail.com>
Date: Thu, 20 Nov 2008 06:55:33 +0100

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.

Regards,
Claus

________________________________________
Von: Colin Fleming [mailto:colin.mailinglist_at_gmail.com]
Gesendet: Mittwoch, 19. November 2008 09:28
An: users_at_jaxb.dev.java.net
Betreff: Re: AW: AW: Duplicated namespace declaration from output xml

Hi all,

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.

Cheers,
Colin