users@jaxb.java.net

Re: map namespace to packages

From: Malachi de Ælfweald <malachid_at_gmail.com>
Date: Wed, 18 Jun 2008 02:47:19 -0700

I like the idea of using the package-info with annotations...

as far as using the NamespacePrefixMapper, take a look at:
http://code.google.com/p/ambrosia/source/browse/trunk/src/main/java/org/eoti/db/mimir/MimirPrefixMapper.java
http://code.google.com/p/ambrosia/source/browse/trunk/src/main/java/org/eoti/db/mimir/MimirContext.java

Malachi

On Wed, Jun 18, 2008 at 2:01 AM, LD16 <dialazein_at_gmail.com> wrote:

>
> Hi Malachi,
>
> Ho do you use this mapping then in Jaxb ? do you have a sample code?
>
> I create a jaxbcontext from a package. i want to map this package
> dynamically to a namespace as the namespace can change. Currently it works
> with package-info.java class that has an annotation @XmlSchema(namespace
> ="http://..." ) but the annotation cant take a parameter.
>
> Thanks
>
> LD
>
>
> Malachi de Ælfweald wrote:
> >
> > I do the following:
> >
> > 1. I map the xmlns/xsd to a package:
> > <xsd:annotation>
> > <xsd:appinfo>
> > <jaxb:schemaBindings>
> > <jaxb:package
> > name="org.eoti.spec.gaea.common.v1"/>
> > </jaxb:schemaBindings>
> > </xsd:appinfo>
> > </xsd:annotation>
> >
> > 2. If I want more than one package, I break it into more than one XSD
> (ie:
> > a
> > little more object oriented)
> >
> > 3. I use NamespacePrefixMapper
> >
> > Malachi
> >
> > On Fri, May 9, 2008 at 10:45 AM, Dovholuk, Clint <
> > Clint.Dovholuk_at_globalcrossing.com> wrote:
> >
> >> Hi All,
> >>
> >>
> >>
> >> Is there a plugin or some switch I can pass to jaxb to allow me to map
> >> namespaces to packages? Mapping schemas to packages is 'ok' but I'd
> >> rather
> >> a finer control over the mappings.
> >>
> >>
> >>
> >> Would a custom xjc plugin be able to accomplish this?
> >>
> >>
> >>
> >> Thanks,
> >>
> >> -Clint
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/map-namespace-to-packages-tp17153205p17975430.html
> Sent from the java.net - jaxb users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>