users@jaxb.java.net

Re: Namespaces in marshalled Node

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 28 Jul 2003 09:53:45 -0700

Jeroen Breedveld <jeroenb_at_x-hive.com> wrote:
> Hi all,
>
> Because I want my marshalled Node to contain a certain namespace I added
> the xmlns="http://www.mycomp.com/user" attribute to my schema
> declaration. However as you can see in the output of my serialized
> document the user-root element contains only the namespace declaration
> "". Can someone please tell me what's causing this?
>
> My schema:
>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns="http://www.mycomp.com/user">

This seems like more of a XML Schema question, but anyway, you have to
add @targetNamespace to <xsd:schema>.

regards,
--
Kohsuke Kawaguchi                  408-276-7063 (x17063)
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com