users@jaxb.java.net

RE: Namespace Prefix

From: Ringeman, Ken <Ken.Ringeman_at_gilbarco.com>
Date: Tue, 19 Oct 2004 15:57:54 -0400

Your are correct. I continue to learn. In this case I have
learned the meaning and purpose of the schema attribute
elementFormDefault. In the first case, the value was set to
qualified. In order to get the results of the second case
I needed to set the value to unqualified.
Thanks
Ken

> -----Original Message-----
> From: Kohsuke Kawaguchi [mailto:Kohsuke.Kawaguchi_at_Sun.COM]
> Sent: Friday, October 08, 2004 4:34 PM
> To: users_at_jaxb.dev.java.net
> Subject: Re: Namespace Prefix
>
> Ringeman, Ken wrote:
> > I have a schema that imports another schema in a different
> namespace.
> > When I generate the code and marshal an object the result
> is similar
> > to the following
> >
> > <ns1:level0 xmlns:ns1="//ns1">
> > ....
> > <ns2:level1 xmlns:ns2="//ns2">
> > <ns2:level2>data</ns2:level2>
> > </ns2:level1>
> > ....
> > </ns1:level0>
> >
> > Is there a way to get the following output?
> >
> > <ns1:level0 xmlns:ns1="//ns1">
> > ....
> > <ns2:level1 xmlns:ns2="//ns2">
> > <level2>data</level2>
> > </ns2:level1>
> > ....
> > </ns1:level0>
> >
> > where the level2 element is by default in the ns2 namespace.
>
> Those two documents that you just described are different
> documents. If the former is valid wrt your schema, the latter
> is most definitely invalid (or vice versa)
>
> Maybe you mean you want to generate:
>
> <ns1:level0 xmlns:ns1="//ns1">
> ....
> <level1 xmlns="//ns2">
> <level2>data</level2>
> </level1>
> ....
> </ns1:level0>
>
> ? If so, does NamespacePrefixMapper works? See the
> namespace-prefix example in the distribution for details.
>
> --
> Kohsuke Kawaguchi
> Sun Microsystems kohsuke.kawaguchi_at_sun.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net