users@jaxb.java.net

Re: Marshal to unqualified form?

From: <david_at_davidkarlsen.com>
Date: Thu, 26 Nov 2009 17:11:28 +0100 (CET)

On Thu, 26 Nov 2009, Wolfgang Laun wrote:

> On Thu, Nov 26, 2009 at 3:15 PM, <david_at_davidkarlsen.com> wrote:
>
> Do I have to write a NamespacePrefixFormatter to get them unqialified? I
>> cannot seem to find any options for the Marshaller to get this OOTB.
>>
>> The other alternative of course, is to change the elementQualification in
>> the schema - but as these are external I'd rather try to avoid that ( and it
>> would be nice to control it at runtime - to be able to support both forms if
>> neccessary).
>>
>> Does this change really remove the NS prefixes from the marshalled XML?
>
> If not, please post the <xs:schema> element in full.
> -W

I was a little short-thought about this.
The jaxbmarshaller was defined with several contexts, hence it knew
several namespaces, and they were all included in the root element and all
the elemes were marshalled with a namespaceprefix.

i split it up in one context pr. schema and the one namespace is then
defined as targetdefault on the root node, and all the children are
defined without prefixes.

--
David J. M. Karlsen - +47 90 68 22 43
http://www.davidkarlsen.com
http://mp3.davidkarlsen.com
Sent from my bog-standard SMTP client